/* ==============================
   RESET & BASE
================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #ff4b2b;
  --primary-light: #ff7357;
  --accent:    #ff9f1c;
  --dark:      #1a1a2e;
  --gray:      #6b7280;
  --light-gray:#f3f4f6;
  --white:     #ffffff;
  --shadow:    0 4px 20px rgba(0,0,0,.08);
  --radius:    14px;
  --transition: .25s ease;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: #f9fafb; color: #111; }

/* ==============================
   NAVBAR
================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; height: 68px;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 700; color: var(--primary);
}
.nav-brand i { font-size: 1.5rem; }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
  text-decoration: none; color: var(--dark);
  font-weight: 500; font-size: .95rem;
  position: relative; padding-bottom: 2px;
  transition: color var(--transition);
}
.nav-links a::after {
  content:''; position:absolute; left:0; bottom:0;
  width:0; height:2px; background:var(--primary);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width:100%; }

.nav-actions { display: flex; gap: 8px; }
.btn-icon {
  position: relative; border: none; background: var(--light-gray);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; color: var(--dark); transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--primary); color: var(--white); }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ==============================
   HERO
================================ */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  min-height: 420px;
  display: flex; align-items: center; padding: 60px 10%;
}
.hero-content { max-width: 580px; color: var(--white); }
.hero-badge {
  display: inline-block;
  background: rgba(255,75,43,.2); border: 1px solid var(--primary);
  color: #ff9f9f; padding: 6px 16px; border-radius: 50px;
  font-size: .85rem; font-weight: 600; margin-bottom: 20px;
}
.hero h1 { font-size: 2.8rem; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero p { font-size: 1.05rem; opacity: .75; margin-bottom: 30px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none; padding: 14px 32px;
  border-radius: 50px; font-size: 1rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 20px rgba(255,75,43,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,75,43,.5); }

/* ==============================
   SECTIONS
================================ */
.section { padding: 60px 5%; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 1.9rem; font-weight: 700; color: var(--dark); }
.section-header p { color: var(--gray); margin-top: 6px; font-size: .95rem; }

/* ==============================
   PROMO CODES
================================ */
#promo-codes {
  background: linear-gradient(180deg, #fff1f3 0%, #fff8f8 55%, #fff 100%);
}
#promo-codes .section-header h2 { color: #242033; }
#promo-codes .section-header p { color: #7a6870; }
.promo-codes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.promo-card {
  background: #ffe9ec;
  border: 1px solid #ffd7dd;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 5px 18px rgba(190, 48, 73, .08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.promo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(190, 48, 73, .15);
}
.promo-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.promo-label { color: #ef3150; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.promo-discount { color: #f22f4e; font-size: 1.35rem; }
.promo-minimum { color: #302833; font-size: .84rem; }
.promo-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 10px;
}
.promo-code-row code { color: var(--dark); font-size: 1rem; font-weight: 700; letter-spacing: 1px; }
.promo-copy-btn {
  border: 0;
  background: #ff3654;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 50px;
  transition: background var(--transition), transform var(--transition);
}
.promo-copy-btn:hover {
  background: #df2340;
  transform: translateY(-1px);
}
.promo-details { display: flex; flex-direction: column; gap: 6px; color: #796a70; font-size: .76rem; }
.promo-details i { color: #ef3150; width: 14px; }
.promo-deal-btn {
  margin-top: auto;
  padding: 10px;
  border-radius: 9px;
  background: #292438;
  color: var(--white);
  text-align: center;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: background var(--transition);
}
.promo-deal-btn:hover { background: var(--primary); }
.promo-loading, .promo-empty, .promo-error {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--gray);
  text-align: center;
}
.promo-error p { margin-bottom: 12px; }
.promo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}
.promo-page-btn {
  border: 0;
  border-radius: 50px;
  padding: 11px 20px;
  background: #ff3654;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.promo-page-btn:hover { background: #df2340; transform: translateY(-1px); }
.promo-page-info { color: #796a70; font-size: .88rem; font-weight: 600; }

@media (max-width: 900px) {
  .promo-codes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .promo-codes-grid { grid-template-columns: 1fr; }
}

/* ==============================
   CATEGORIES
================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 18px;
}

.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.cat-card:hover, .cat-card.active {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  border-color: var(--primary);
}
.cat-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--white);            /* ← white background */
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.9rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.cat-name { font-size: .82rem; font-weight: 600; color: var(--dark); line-height: 1.3; }
.cat-count { font-size: .72rem; color: var(--gray); margin-top: 4px; }

/* ==============================
   FILTER TABS
================================ */
.filter-tabs {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 20px;
}
.tab {
  padding: 8px 22px; border-radius: 50px;
  border: 2px solid var(--light-gray);
  background: var(--white); font-size: .88rem; font-weight: 500;
  cursor: pointer; color: var(--gray);
  transition: all var(--transition);
}
.tab:hover, .tab.active {
  background: var(--primary); color: var(--white); border-color: var(--primary);
}

/* ==============================
   PRODUCTS GRID
================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
}

/* Offer badge */
.offer-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--primary);
  color: #fff; font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 50px;
  z-index: 2;
}

/* Wishlist */
.wishlist-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255,255,255,.85); border: none;
  width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 1rem; color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}
.wishlist-btn:hover, .wishlist-btn.liked { color: var(--primary); background: #fff; }

/* Product image */
.product-image-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.product-img-wrap {
  width: 100%; height: 200px;
  background: #fff;             /* ← white background behind image */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

/* Product info */
.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.product-category {
  font-size: .72rem; font-weight: 600; color: var(--primary);
  text-transform: uppercase; letter-spacing: .5px;
}
.product-title {
  font-size: .95rem; font-weight: 600; color: var(--dark);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-title-link {
  text-decoration: none;
}
.product-title-link:hover {
  color: var(--primary);
}

/* Price row */
.price-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.price-current {
  font-size: 1.2rem; font-weight: 700; color: var(--primary);
}
.price-original {
  font-size: .85rem; color: var(--gray);
  text-decoration: line-through;
}
.price-save {
  font-size: .75rem; font-weight: 600;
  background: #fff3f3; color: var(--primary);
  padding: 2px 8px; border-radius: 50px;
}

/* Offer field */
.offer-box {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px dashed var(--accent);
  border-radius: 8px; padding: 8px 12px;
  font-size: .78rem; color: #856404;
  display: flex; align-items: center; gap: 6px;
}
.offer-box i { color: var(--accent); }

/* Rating */
.rating { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--gray); }
.stars { color: #f59e0b; }

/* Add to cart button */
.add-cart-btn {
  margin-top: auto;
  width: 100%; padding: 11px;
  background: var(--dark); color: #fff;
  border: none; border-radius: 10px;
  font-size: .9rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition);
}
.add-cart-btn:hover { background: var(--primary); }

/* ==============================
   FOOTER
================================ */
.footer { background: var(--dark); color: rgba(255,255,255,.75); padding: 50px 5% 20px; }
.footer-inner {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 36px; margin-bottom: 32px;
}
.footer-brand { font-size: 1.3rem; font-weight: 700; color: #fff; }
.footer-brand p { font-size: .85rem; font-weight: 400; color: rgba(255,255,255,.5); margin-top: 8px; }
.footer-links h4, .footer-social h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,.6); text-decoration: none; font-size: .88rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--primary); }
.socials { display: flex; gap: 14px; }
.socials a {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; font-size: 1rem;
  transition: background var(--transition);
}
.socials a:hover { background: var(--primary); }
.footer-copy { text-align: center; font-size: .8rem; color: rgba(255,255,255,.35); padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }

/* ==============================
   TOAST
================================ */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #1f2937; color: #fff;
  padding: 14px 22px; border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: .9rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transform: translateY(80px); opacity: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast i { color: #22c55e; font-size: 1.1rem; }

/* ==============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 1.9rem; }
  .hero { padding: 50px 6%; }
}

/* ── Hero stats ───────────────────────── */
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px;
}
.hero-stats span {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px; padding: 5px 14px; font-size: .82rem; color: rgba(255,255,255,.85);
}

/* ── Skeleton loaders ─────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton-cat, .skeleton-prod {
  border-radius: var(--radius);
  background: linear-gradient(90deg,#f0f0f0 25%,#e4e4e4 50%,#f0f0f0 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-cat  { height: 110px; }
.skeleton-prod { height: 340px; }

/* ── Empty / error states ─────────────── */
.empty-state {
  grid-column: 1 / -1; text-align: center;
  padding: 60px 20px; color: #9ca3af;
}
.empty-state h3 { font-size: 1.3rem; color: #6b7280; margin: 12px 0 8px; }
.empty-state p  { font-size: .9rem; line-height: 1.6; }

.api-error { color: #ef4444; padding: 20px; }
.api-error-box {
  grid-column: 1 / -1; text-align: center;
  padding: 50px 20px; color: #9ca3af;
}
.api-error-box span { font-size: 2.5rem; display: block; }
.api-error-box p    { margin: 12px 0; font-size: .9rem; line-height: 1.6; }
.btn-retry {
  background: var(--primary); color: #fff;
  border: none; padding: 10px 24px;
  border-radius: 50px; cursor: pointer;
  font-weight: 600; font-size: .9rem;
  transition: opacity .2s;
}
.btn-retry:hover { opacity: .85; }
