/**
 * css/home.css
 * Homepage-specific styles.
 * Extends style.css — do NOT redefine :root or global resets here.
 * Loaded only on index.php.
 */

/* ── Full-bleed wrapper (replaces .container on sections) ───── */
.full-container {
  width: 100%;
  max-width: 100%;
  padding: 0 16px;
}

/* ── Product sections ────────────────────────────────────────── */
.products {
  padding: 48px 0;
  background: #f8fafb;
}
.products:nth-child(even) { background: #fff; }

/* ── Section header — single line, no wrap ───────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.section-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.05rem, 2.4vw, 1.65rem);
  font-weight: 800;
  color: #111827;
  /* single line on all screen sizes */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* ── Filter tabs ─────────────────────────────────────────────── */
.product-tabs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.product-tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 7px 16px;
  border-radius: 50px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  /* larger tap target on mobile */
  min-height: 34px;
}
.tab:hover   { border-color: #16a34a; color: #16a34a; }
.tab.active  { background: #16a34a; border-color: #16a34a; color: #fff; }

/* ── Product grid — fills full width ─────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  width: 100%;
}

/* ── Product card ────────────────────────────────────────────── */
.product-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  width: 100%;
  /* GPU composite — smooth hover, no reflow */
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.15);
  border-color: #16a34a;
}

/* ── Product image — aspect-ratio prevents CLS ───────────────── */
.product-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.emoji-icon { font-size: 2.5rem; }

/* ── Product info ────────────────────────────────────────────── */
.product-info   { padding: 10px; }
.product-brand  { font-size: 10px; color: #16a34a; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.product-sku    {
  font-size: 12px; font-weight: 500; line-height: 1.35; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-rating { font-size: 11px; color: #f59e0b; margin-bottom: 5px; }
.product-rating span { color: #9ca3af; font-size: 10px; }
.product-price  { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.price-now      { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: #111827; }
.price-old      { font-size: 11px; color: #9ca3af; text-decoration: line-through; }

/* ── Badge ───────────────────────────────────────────────────── */
.product-badge {
  position: absolute; top: 8px; left: 8px;
  background: #13b348; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; z-index: 1;
}
.product-badge.new { background: #16a34a; }

/* ── Add to Cart button ──────────────────────────────────────── */
.add-cart-btn {
  width: 100%;
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 8px 6px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  min-height: 32px;
  transition: background 0.2s;
}
.add-cart-btn:hover:not(:disabled) { background: #166534; }
.add-cart-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Wishlist button ─────────────────────────────────────────── */
.card-wl-btn {
  position: absolute; top: 8px; right: 8px;
  background: #fff; border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  z-index: 2;
  transition: background 0.15s;
}
.card-wl-btn:hover { background: #dcfce7; }

/* ── See More ────────────────────────────────────────────────── */
.see-more-wrap { text-align: center; margin-top: 20px; }
.see-more-btn {
  background: #fff;
  color: #16a34a;
  border: 2px solid #16a34a;
  padding: 10px 32px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, color 0.2s;
}
.see-more-btn:hover { background: #16a34a; color: #fff; }
.see-more-count { font-weight: 400; opacity: 0.8; }

/* ── No products ─────────────────────────────────────────────── */
.no-products { padding: 40px; text-align: center; color: #6b7280; font-size: 0.9rem; }

/* ── Toast ───────────────────────────────────────────────────── */
.fc-toast {
  position: fixed; bottom: 20px; right: 20px;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 10000;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  pointer-events: none;
  animation: fcSlideIn 0.25s ease;
}
.fc-toast.success { background: #16a34a; }
.fc-toast.error   { background: #dc2626; }

@keyframes fcSlideIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fcSlideOut { from { transform: translateX(0); opacity: 1; }    to { transform: translateX(110%); opacity: 0; } }

/* ── Testimonials ────────────────────────────────────────────── */
.testimonial-section { padding: 60px 16px; background: #f8fafc; }
.section-title {
  text-align: center;
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  font-weight: 700;
  margin-bottom: 32px;
  color: #111827;
}
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.testimonial-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: transform 0.2s;
}
.testimonial-card:hover { transform: translateY(-4px); }
.stars       { color: #f59e0b; font-size: 14px; margin-bottom: 8px; }
.review-text { font-size: 14px; color: #444; line-height: 1.6; margin-bottom: 12px; }
.name        { font-size: 13px; font-weight: 600; color: #111; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
/* 4-col tablet */
@media (max-width: 1199px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
/* 3-col small tablet */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
  .section-header h2 { white-space: normal; font-size: 1.1rem; }
}
/* 2-col phone */
@media (max-width: 600px) {
  .product-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .full-container { padding: 0 10px; }
  .products       { padding: 32px 0; }
  .product-info   { padding: 8px; }
  .price-now      { font-size: 13px; }
  .add-cart-btn   { font-size: 11px; padding: 7px 4px; }
  .product-badge  { font-size: 9px; padding: 2px 6px; }
}