/* ============================================================
   African & Exotic Grocery Store — style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   1. CSS Variables
   ============================================================ */
:root {
  --green:       #1a6b3c;
  --green-dark:  #145530;
  --green-light: #2d8a52;
  --gold:        #f5a623;
  --gold-dark:   #d4891a;
  --white:       #ffffff;
  --bg:          #f8f9fa;
  --text:        #2c2c2c;
  --text-light:  #666;
  --border:      #e0e0e0;
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.1);
  --radius:      12px;
  --transition:  all 0.3s ease;
}

/* ============================================================
   2. Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
}

input,
textarea,
select {
  font-family: 'Poppins', sans-serif;
  outline: none;
}

/* ============================================================
   3. Header / Navbar
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--white);
  box-shadow: var(--shadow);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1rem;
  position: relative;
}

/* Logo */
.nav-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-logo span {
  color: var(--gold);
}

/* Nav links — hidden on mobile */
.nav-links {
  display: none;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--green);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--green);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--green);
  font-weight: 600;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Track order button */
.btn-track {
  display: none;
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  transition: var(--transition);
}

.btn-track:hover {
  background-color: var(--green);
  color: var(--white);
}

/* Cart Button */
.btn-cart, .cart-btn {
  position: relative;
  background-color: var(--green);
  color: var(--white);
  padding: 0.55rem 1.2rem 0.55rem 1rem;
  border-radius: 30px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(45,140,78,0.35);
}

.cart-btn-label {
  font-size: 0.92rem;
  font-weight: 700;
}

.cart-btn-label span {
  font-weight: 800;
}

.btn-cart:hover, .cart-btn:hover {
  background-color: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(45,140,78,0.4);
}

.btn-cart .cart-icon {
  font-size: 1.1rem;
  color: var(--gold);
}

/* Hamburger */
.btn-hamburger, .hamburger {
  background: none;
  border: none;
  color: var(--green);
  font-size: 2rem;
  padding: 0.25rem 0.4rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
  line-height: 1;
}

.btn-hamburger:hover, .hamburger:hover {
  color: var(--green-dark);
  background: rgba(45,140,78,0.08);
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  background-color: var(--white);
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem 1.5rem;
  gap: 0.25rem;
}

.mobile-nav.open {
  display: flex;
}

.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  padding: 0.5rem 1rem 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 999;
  gap: 0;
}
.nav-links.open a {
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
  display: block;
}

.mobile-nav a {
  padding: 0.65rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover {
  color: var(--green);
  padding-left: 1rem;
}

/* ============================================================
   Responsive — Tablet & Desktop navbar
   ============================================================ */
@media (min-width: 768px) {
  .btn-track {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .btn-hamburger {
    display: none;
  }
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }

  .navbar {
    padding: 0.9rem 2rem;
  }
}

/* ============================================================
   4. Hero Banner
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0.8rem 1rem;
}

/* African-pattern overlay using CSS */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(245, 166, 35, 0.06) 0px,
      rgba(245, 166, 35, 0.06) 2px,
      transparent 2px,
      transparent 20px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 2px,
      transparent 2px,
      transparent 20px
    );
  pointer-events: none;
}

/* Decorative circles */
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, 0.04);
  top: -200px;
  right: -150px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  width: 100%;
}

.hero-tag {
  display: inline-block;
  background-color: rgba(245, 166, 35, 0.2);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  border: 1px solid rgba(245, 166, 35, 0.4);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.hero h1 span {
  color: var(--gold);
}

.hero-subtitle {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.8rem;
  font-weight: 400;
}

.hero-btns {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background-color: var(--white);
  color: var(--green);
  padding: 0.75rem 1.75rem;
  border-radius: 30px;
  font-size: 0.92rem;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-hero-primary:hover {
  background-color: var(--gold);
  color: var(--green-dark);
  transform: translateY(-2px);
}

.btn-hero-secondary {
  background-color: transparent;
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 30px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 2px solid var(--gold);
  transition: var(--transition);
}

.btn-hero-secondary:hover {
  background-color: var(--gold);
  color: var(--green-dark);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 2rem 1.5rem;
  }

  .hero h1 {
    font-size: 2.6rem;
  }
}

/* ============================================================
   5. Category Cards Grid
   ============================================================ */
.categories-section {
  padding: 3rem 1.25rem;
  background-color: var(--bg);
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.section-header h2 span {
  color: var(--green);
}

.section-header p {
  color: var(--text-light);
  font-size: 0.92rem;
}

.section-divider {
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.category-card {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transform: scaleX(0);
  transition: var(--transition);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-bottom-color: var(--gold);
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.category-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.25rem;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.85rem;
}

.btn-shop-now {
  background-color: var(--gold);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-shop-now:hover {
  background-color: var(--gold-dark);
  transform: scale(1.05);
}


/* Hide subtitle on small phones to save space */
@media (max-width: 480px) {
  .hero-subtitle { display: none; }
  .hero-features { display: none; }
}

@media (min-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ============================================================
   6. Products Section
   ============================================================ */
.products-section {
  width: 100%;
  background-color: var(--white);
  padding: 2rem 1.25rem 3rem;
  min-height: 60vh;
}

.products-section-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--green);
  color: var(--white);
  padding: 0.55rem 1.1rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.btn-back:hover {
  background-color: var(--green-dark);
  transform: translateX(-3px);
}

.btn-back .arrow {
  font-size: 1rem;
  transition: var(--transition);
}

.btn-back:hover .arrow {
  transform: translateX(-3px);
}

/* Category Title */
.products-category-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.products-category-title .title-emoji {
  font-size: 1.8rem;
}

/* Subcategory Tabs */
.subcategory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1.75rem;
}

.subcategory-tabs::-webkit-scrollbar {
  height: 4px;
}

.subcategory-tabs::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 2px;
}

.subcategory-tabs::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 2px;
}

.tab-btn {
  flex-shrink: 0;
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid var(--green);
  background-color: transparent;
  color: var(--green);
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover,
.tab-btn.active {
  background-color: var(--green);
  color: var(--white);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Product Card */
.product-card {
  background-color: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  border-color: var(--green-light);
}

.product-card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.product-img-wrap {
  background-color: var(--bg);
  border-radius: 10px 10px 0 0;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  overflow: hidden;
  position: relative;
}

.product-img-wrap img {
  width: 100%;
  height: 165px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 10px 10px 0 0;
  transition: transform 0.3s ease;
  background: var(--bg);
  padding: 6px;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.prod-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.42);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 10px 10px 0 0;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.product-card:hover .prod-img-overlay {
  opacity: 1;
}

.cooking-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #fff3e0;
  color: #c47d0e;
  border: 1px solid #f5a623;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  margin-bottom: 0.2rem;
  width: fit-content;
}

.product-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.1rem;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.product-price .currency {
  font-size: 0.85rem;
  font-weight: 600;
}

.product-unit {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: -0.35rem;
}

/* On Request badge */
.badge-on-request {
  display: inline-block;
  background-color: rgba(245, 166, 35, 0.12);
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-add-cart {
  background-color: var(--green);
  color: var(--white);
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-add-cart:hover {
  background-color: var(--gold);
  color: var(--green-dark);
  transform: translateY(-1px);
}

/* Cooking option buttons in product detail modal */
.cook-opt-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #ddd;
  border-radius: 22px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'Poppins', sans-serif;
}

.cook-opt-btn:hover {
  border-color: #2d8c4e;
  color: #2d8c4e;
}

.cook-opt-btn.selected {
  background: #2d8c4e;
  border-color: #2d8c4e;
  color: #fff;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .product-img-wrap {
    min-height: 180px;
  }

  .product-img-wrap img {
    height: 190px;
    object-fit: contain;
    padding: 8px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   7. Cart Sidebar
   ============================================================ */

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.cart-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  background-color: var(--white);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.18);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-sidebar.open {
  transform: translateX(0);
}

/* Cart Header */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem;
  border-bottom: 1.5px solid var(--border);
  background-color: var(--green);
  color: var(--white);
  flex-shrink: 0;
}

.cart-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-cart {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-close-cart:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Cart Items */
.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--border);
}

.cart-items-list::-webkit-scrollbar {
  width: 5px;
}

.cart-items-list::-webkit-scrollbar-track {
  background: var(--bg);
}

.cart-items-list::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 3px;
}

/* Empty cart state */
.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.cart-empty .empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
}

.cart-empty p {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Cart item row */
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  grid-column: 1 / -1;
}

.cart-item-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover {
  background-color: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.qty-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 20px;
  text-align: center;
}

.btn-remove-item {
  background: none;
  color: #e53e3e;
  font-size: 1rem;
  padding: 0.1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.btn-remove-item:hover {
  transform: scale(1.2);
  color: #c53030;
}

/* Cart Footer */
.cart-footer {
  padding: 1.25rem;
  border-top: 2px solid var(--border);
  flex-shrink: 0;
  background-color: var(--white);
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-light);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.cart-total .total-amount {
  color: var(--green);
  font-size: 1.2rem;
}

.btn-checkout {
  width: 100%;
  background-color: var(--green);
  color: var(--white);
  padding: 0.85rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-checkout:hover {
  background-color: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.35);
}

@media (min-width: 768px) {
  .cart-sidebar {
    width: 380px;
  }
}

/* ============================================================
   8. Checkout Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background-color: var(--white);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--border);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.modal-overlay.visible .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.checkout-modal,
.confirmation-modal {
  background-color: var(--white);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--border);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.modal-overlay.visible .checkout-modal,
.modal-overlay.visible .confirmation-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-box::-webkit-scrollbar {
  width: 5px;
}

.modal-box::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 3px;
}

/* Steps Indicator */
.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem 0;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background-color: var(--border);
  z-index: 0;
}

.step.done:not(:last-child)::after,
.step.active:not(:last-child)::after {
  background-color: var(--green);
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.step.active .step-circle {
  border-color: var(--green);
  background-color: var(--green);
  color: var(--white);
}

.step.done .step-circle {
  border-color: var(--green);
  background-color: var(--green);
  color: var(--white);
}

.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

.step.active .step-label {
  color: var(--green);
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1.5px solid var(--border);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.btn-close-modal {
  background: var(--bg);
  color: var(--text-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-close-modal:hover {
  background-color: #ffe0e0;
  color: #e53e3e;
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
}

/* Form styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.form-group label .required {
  color: #e53e3e;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  background-color: var(--white);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
}

.form-control::placeholder {
  color: #bbb;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Radio payment methods */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.payment-option:hover {
  border-color: var(--green);
  background-color: rgba(26, 107, 60, 0.03);
}

.payment-option input[type="radio"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.payment-option input[type="radio"]:checked + .payment-option-label {
  color: var(--green);
  font-weight: 600;
}

.payment-option.selected {
  border-color: var(--green);
  background-color: rgba(26, 107, 60, 0.05);
}

.payment-option-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.payment-option-label .pay-icon {
  font-size: 1.2rem;
}

/* Bank transfer box */
.bank-transfer-box {
  background-color: rgba(245, 166, 35, 0.08);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 1.1rem;
  margin-top: 1rem;
}

.bank-transfer-box h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bank-details-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(245, 166, 35, 0.3);
}

.bank-details-row:last-of-type {
  border-bottom: none;
  margin-bottom: 0.75rem;
}

.bank-details-row .bd-label {
  color: var(--text-light);
  font-weight: 500;
}

.bank-details-row .bd-value {
  color: var(--text);
  font-weight: 700;
}

/* File upload */
.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--bg);
  text-align: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.file-upload-label:hover {
  border-color: var(--green);
  background-color: rgba(26, 107, 60, 0.04);
}

.file-upload-label .upload-icon {
  font-size: 2rem;
  color: var(--green);
}

.file-upload-label .upload-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.file-upload-label .upload-hint {
  font-size: 0.73rem;
  color: var(--text-light);
}

.file-upload-label input[type="file"] {
  display: none;
}

/* Submit button */
.btn-submit-order {
  width: 100%;
  background-color: var(--green);
  color: var(--white);
  padding: 0.95rem;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn-submit-order:hover {
  background-color: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.35);
}

/* ============================================================
   9. Order Confirmation Modal
   ============================================================ */
.confirmation-modal .modal-box {
  text-align: center;
}

.confirmation-body {
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.success-check-circle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 8px 25px rgba(26, 107, 60, 0.35);
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  80%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.confirmation-body h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green);
}

.order-number-box {
  background: rgba(245, 166, 35, 0.12);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 0.6rem 1.5rem;
}

.order-number-box p {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 0.1rem;
}

.order-number-box .order-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-dark);
  letter-spacing: 1px;
}

.confirmation-message {
  font-size: 0.88rem;
  color: var(--text-light);
  max-width: 380px;
  line-height: 1.7;
}

.confirmation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 320px;
  margin-top: 0.5rem;
}

.btn-track-order {
  background-color: var(--green);
  color: var(--white);
  padding: 0.8rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-track-order:hover {
  background-color: var(--green-dark);
  transform: translateY(-1px);
}

.btn-continue-shopping {
  background-color: transparent;
  color: var(--green);
  padding: 0.8rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1.5px solid var(--green);
  transition: var(--transition);
}

.btn-continue-shopping:hover {
  background-color: var(--green);
  color: var(--white);
}

/* ============================================================
   10. Order Tracking Section
   ============================================================ */
.tracking-section {
  padding: 3rem 1.25rem;
  background-color: var(--bg);
}

.tracking-inner {
  max-width: 500px;
  margin: 0 auto;
}

.tracking-inner h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.5rem;
}

.tracking-inner .tracking-sub {
  text-align: center;
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
}

/* Lookup input */
.tracking-lookup {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.tracking-lookup .form-control {
  flex: 1;
}

.btn-lookup {
  background-color: var(--green);
  color: var(--white);
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-lookup:hover {
  background-color: var(--green-dark);
}

/* Status card */
.tracking-card {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tracking-card-header {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  padding: 1.25rem 1.5rem;
}

.tracking-card-header h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tracking-card-header p {
  font-size: 0.8rem;
  opacity: 0.85;
}

.tracking-timeline {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-step {
  display: flex;
  gap: 1rem;
  position: relative;
}

.timeline-step:not(:last-child) {
  padding-bottom: 1.5rem;
}

.timeline-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 36px;
  width: 2px;
  height: calc(100% - 36px);
  background-color: var(--border);
}

.timeline-step.done:not(:last-child)::before,
.timeline-step.active:not(:last-child)::before {
  background-color: var(--green);
}

.timeline-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.timeline-step.done .timeline-icon-wrap {
  border-color: var(--green);
  background-color: var(--green);
  color: var(--white);
}

.timeline-step.active .timeline-icon-wrap {
  border-color: var(--green);
  background-color: var(--green);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(26, 107, 60, 0.18);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(26, 107, 60, 0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(26, 107, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 107, 60, 0); }
}

.timeline-content {
  padding-top: 0.5rem;
}

.timeline-content h5 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-step.done .timeline-content h5,
.timeline-step.active .timeline-content h5 {
  color: var(--green);
}

.timeline-content p {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

/* ============================================================
   11. Admin Styles
   ============================================================ */

/* Admin Login */
.admin-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-card {
  background-color: var(--white);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.admin-login-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 0.25rem;
}

.admin-login-logo span {
  color: var(--gold);
}

.admin-login-sub {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.admin-login-card .form-group {
  text-align: left;
}

.btn-admin-login {
  width: 100%;
  background-color: var(--green);
  color: var(--white);
  padding: 0.85rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
  margin-top: 0.5rem;
}

.btn-admin-login:hover {
  background-color: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.3);
}

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--green-dark) 0%, #0d3d22 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 900;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.admin-sidebar.open,
.admin-sidebar.always-open {
  transform: translateX(0);
}

.admin-sidebar-logo {
  padding: 1.5rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-sidebar-logo span {
  color: var(--gold);
}

.admin-sidebar-logo .admin-badge {
  font-size: 0.65rem;
  background: var(--gold);
  color: var(--green-dark);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-nav {
  flex: 1;
  padding: 1rem 0;
}

.admin-nav-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.5rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  transition: var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.admin-nav-link .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.admin-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-left-color: var(--gold);
}

.admin-nav-link.active {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-weight: 700;
  border-left-color: var(--gold);
}

.admin-nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--green-dark);
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Admin Main */
.admin-main {
  flex: 1;
  padding: 1.5rem 1.25rem;
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .admin-main {
    margin-left: 250px;
    padding: 2rem;
  }

  .admin-sidebar {
    transform: translateX(0);
  }
}

/* ── Sidebar classes used in admin.html ─────────────────── */
.sidebar-logo {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left-color: #f5a623;
}
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.82rem;
}
.logout-btn {
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.4);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.logout-btn:hover {
  background: #e74c3c;
  color: #fff;
}

/* Mobile: top nav bar */
@media (max-width: 767px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100% !important;
    height: auto !important;
    position: sticky !important;
    top: 0 !important;
    transform: none !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 0.5rem 0.75rem !important;
    z-index: 999 !important;
    overflow: visible !important;
  }
  .sidebar-logo {
    flex: 1;
    border-bottom: none;
    padding: 0;
    font-size: 0.85rem;
  }
  .sidebar-nav {
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0.25rem;
    flex: 0;
  }
  .sidebar-link {
    padding: 0.4rem 0.5rem !important;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    font-size: 0.75rem !important;
    flex-direction: column;
    gap: 0.1rem;
    text-align: center;
    border-radius: 6px;
    white-space: nowrap;
  }
  .sidebar-link span.link-label { display: none; }
  .sidebar-link.active {
    border-bottom-color: #f5a623 !important;
    background: rgba(255,255,255,0.1) !important;
  }
  .sidebar-footer {
    flex-direction: row !important;
    border-top: none !important;
    padding: 0 !important;
    gap: 0.4rem;
    align-items: center;
    flex: 0;
  }
  .sidebar-footer a { display: none; }
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* Admin Page Header */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.admin-page-header h1 span {
  color: var(--green);
}

/* Stat Cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.admin-stat-card {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition);
  border-left: 4px solid var(--green);
  position: relative;
  overflow: hidden;
}

.admin-stat-card:nth-child(2) { border-left-color: var(--gold); }
.admin-stat-card:nth-child(3) { border-left-color: #3b82f6; }
.admin-stat-card:nth-child(4) { border-left-color: #8b5cf6; }

.admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}

.stat-change {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.stat-change.up   { color: #16a34a; }
.stat-change.down { color: #dc2626; }

/* Admin Tables */
.admin-table-wrap {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-table-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.admin-table th {
  background-color: var(--bg);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.9rem 1.25rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--border);
}

.admin-table td {
  font-size: 0.87rem;
  color: var(--text);
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background-color: rgba(26, 107, 60, 0.03);
}

.admin-table tr:nth-child(even) td {
  background-color: rgba(248, 249, 250, 0.6);
}

.admin-table tr:nth-child(even):hover td {
  background-color: rgba(26, 107, 60, 0.03);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-pending {
  background-color: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-processing {
  background-color: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-dispatched {
  background-color: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-delivered {
  background-color: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-cancelled {
  background-color: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Table action buttons */
.table-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.btn-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-action-view   { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.btn-action-edit   { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.btn-action-delete { background: rgba(220, 38, 38, 0.1);  color: #dc2626; }

.btn-action:hover {
  transform: scale(1.1);
  opacity: 0.85;
}

/* Admin Tab Nav */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
  background: none;
}

.admin-tab-btn:hover {
  color: var(--green);
}

.admin-tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* Admin Form card */
.admin-form-card {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.admin-form-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .form-row.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.form-row-full {
  grid-column: 1 / -1;
}

.btn-admin-submit {
  background-color: var(--green);
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
  margin-top: 1rem;
}

.btn-admin-submit:hover {
  background-color: var(--green-dark);
  transform: translateY(-1px);
}

/* ============================================================
   12. Utilities
   ============================================================ */

/* Hidden */
.hidden {
  display: none !important;
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.fade-in-slow {
  animation: fadeIn 0.7s ease forwards;
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }

/* Loading spinner */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 3px;
  display: inline-block;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background-color: var(--white);
  border-radius: 10px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 260px;
  max-width: 340px;
  pointer-events: all;
  animation: toast-slide-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  border-left: 4px solid var(--green);
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.hiding {
  animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(80px);
  }
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
}

.toast-text .toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.toast-text .toast-msg {
  font-size: 0.78rem;
  color: var(--text-light);
}

.toast-close {
  background: none;
  color: var(--text-light);
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0;
  transition: var(--transition);
}

.toast-close:hover {
  color: var(--text);
}

.toast-success  { border-left-color: #16a34a; }
.toast-error    { border-left-color: #dc2626; }
.toast-warning  { border-left-color: var(--gold); }
.toast-info     { border-left-color: #2563eb; }

/* Scrollbar styling (cart / modal) */
.styled-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--border);
}

.styled-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.styled-scroll::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.styled-scroll::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 3px;
}

/* Misc helpers */
.text-green       { color: var(--green); }
.text-gold        { color: var(--gold-dark); }
.text-light       { color: var(--text-light); }
.font-bold        { font-weight: 700; }
.text-sm          { font-size: 0.82rem; }
.text-center      { text-align: center; }
.mt-1             { margin-top: 0.5rem; }
.mt-2             { margin-top: 1rem; }
.mb-1             { margin-bottom: 0.5rem; }
.mb-2             { margin-bottom: 1rem; }

.btn-green {
  background-color: var(--green);
  color: var(--white);
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-green:hover {
  background-color: var(--green-dark);
  transform: translateY(-1px);
}

.btn-gold {
  background-color: var(--gold);
  color: var(--green-dark);
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition);
}

.btn-gold:hover {
  background-color: var(--gold-dark);
  transform: translateY(-1px);
}

.btn-outline-green {
  background-color: transparent;
  color: var(--green);
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1.5px solid var(--green);
  transition: var(--transition);
}

.btn-outline-green:hover {
  background-color: var(--green);
  color: var(--white);
}

/* ============================================================
   13. Footer
   ============================================================ */
.footer {
  background: linear-gradient(180deg, var(--green-dark) 0%, #0d3d22 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: 3.5rem 1.25rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
  }
}

/* Column 1 — Logo + description */
.footer-brand .footer-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.footer-brand .footer-logo span {
  color: var(--gold);
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.25rem;
}

.footer-socials {
  display: flex;
  gap: 0.6rem;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-btn:hover {
  background-color: var(--gold);
  color: var(--green-dark);
  transform: translateY(-2px);
}

/* Columns 2 & 3 */
.footer-col h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.1rem;
  position: relative;
  padding-bottom: 0.6rem;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--gold);
  border-radius: 1px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--gold);
  transform: translateX(4px);
}

.footer-links a::before {
  content: '›';
  color: var(--gold);
  font-weight: 700;
}

/* Contact info */
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-contact-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.footer-contact-item .contact-icon {
  font-size: 1rem;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 1px;
}

.footer-contact-item p {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
}

/* Copyright bar */
.footer-bar, .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.1rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bar p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bar a {
  color: rgba(255, 255, 255, 0.6);
  transition: var(--transition);
}

.footer-bar a:hover {
  color: var(--gold);
}

/* ============================================================
   End of style.css
   ============================================================ */

/* ============================================================
   ADMIN PANEL — FIXES (appended)
   ============================================================ */

/* Fix modal visibility — show when .hidden is removed */
.modal-overlay:not(.hidden) {
  opacity: 1 !important;
  pointer-events: all !important;
}

/* Admin Modal box styling */
.admin-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: #1a6b3c; }
.close-btn {
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: #999; line-height: 1;
  padding: 0.25rem 0.5rem; border-radius: 6px;
}
.close-btn:hover { background: #f5f5f5; color: #333; }

.admin-modal form { padding: 1.25rem 1.5rem; }
.modal-footer {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  padding-top: 1rem; border-top: 1px solid #eee; margin-top: 1rem;
}

/* Form styles inside admin */
.admin-modal .form-group { margin-bottom: 1rem; }
.admin-modal .form-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; color: #444; }
.admin-modal .form-group input,
.admin-modal .form-group select,
.admin-modal .form-group textarea {
  width: 100%; padding: 0.55rem 0.85rem; border: 1.5px solid #ddd;
  border-radius: 8px; font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.2s;
}
.admin-modal .form-group input:focus,
.admin-modal .form-group select:focus {
  outline: none; border-color: #1a6b3c;
}
.admin-modal .form-row { display: flex; gap: 1rem; }
.admin-modal .form-row .form-group { flex: 1; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  border-left: 4px solid #1a6b3c;
}
.stat-card.warning { border-left-color: #f5a623; }
.stat-card.success { border-left-color: #27ae60; }
.stat-card.info    { border-left-color: #3498db; }
.stat-icon { font-size: 1.8rem; }
.stat-number { font-size: 1.5rem; font-weight: 800; color: #1a6b3c; line-height: 1; }
.stat-label  { font-size: 0.78rem; color: #888; margin-top: 0.2rem; }

/* Recent orders card */
.recent-orders-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.recent-orders-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: #1a6b3c; }
.recent-order-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.65rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem;
}
.recent-order-row:last-child { border-bottom: none; }
.order-num  { font-weight: 700; color: #1a6b3c; min-width: 60px; }
.order-customer { flex: 1; min-width: 100px; }
.order-total { font-weight: 700; }
.order-date { color: #999; font-size: 0.78rem; }

/* Table */
.table-container { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { background: #1a6b3c; color: #fff; padding: 0.75rem 1rem; text-align: left; font-weight: 600; white-space: nowrap; }
.admin-table td { padding: 0.7rem 1rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.admin-table tbody tr:hover { background: #f9fffe; }
.admin-table .empty-state { text-align: center; color: #aaa; padding: 2rem; }

/* Buttons */
.btn-sm {
  padding: 0.3rem 0.65rem; border-radius: 6px; font-size: 0.78rem;
  font-weight: 600; cursor: pointer; border: 1.5px solid transparent;
  transition: all 0.2s; font-family: inherit;
}
.btn-sm.btn-outline { border-color: #1a6b3c; color: #1a6b3c; background: transparent; }
.btn-sm.btn-outline:hover { background: #1a6b3c; color: #fff; }
.btn-sm.btn-danger { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.btn-sm.btn-danger:hover { background: #c0392b; border-color: #c0392b; }
.btn-sm.btn-info { background: #3498db; color: #fff; border-color: #3498db; }

/* Status */
.status-badge, .payment-badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.payment-badge { background: #eaf7ff; color: #3498db; }
.status-select {
  padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.8rem;
  border: 1.5px solid #ddd; cursor: pointer; font-family: inherit;
}
.status-select.status-pending    { border-color: #f5a623; color: #d4891a; }
.status-select.status-processing { border-color: #3498db; color: #3498db; }
.status-select.status-dispatched { border-color: #9b59b6; color: #9b59b6; }
.status-select.status-delivered  { border-color: #27ae60; color: #27ae60; }

/* Category admin grid */
.categories-admin-grid {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.category-admin-card {
  background: #fff; border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.cat-admin-emoji { font-size: 2rem; width: 48px; text-align: center; }
.cat-admin-info  { flex: 1; }
.cat-admin-name  { font-weight: 700; font-size: 0.95rem; }
.cat-admin-desc  { font-size: 0.8rem; color: #888; }
.cat-admin-count { font-size: 0.78rem; color: #1a6b3c; font-weight: 600; margin-top: 0.2rem; }
.cat-admin-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Admin filters */
.admin-filters {
  display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.admin-filters select,
.admin-filters input {
  padding: 0.5rem 0.85rem; border: 1.5px solid #ddd; border-radius: 8px;
  font-size: 0.88rem; font-family: inherit;
}
.admin-filters input { flex: 1; min-width: 160px; }

/* Header actions */
.header-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* Misc */
.text-muted { color: #aaa; font-size: 0.78rem; }
code { background: #f0f0f0; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.78rem; }
.empty-state { text-align: center; color: #aaa; padding: 2rem 1rem; }

/* ============================================================
   MOBILE RESPONSIVENESS — Global Fixes
   ============================================================ */

/* Prevent any element from causing horizontal scroll */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Container — constrain width and add horizontal padding */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* ---- Small phones: up to 480px ---- */
@media (max-width: 480px) {

  /* Navbar */
  .navbar { padding: 0.7rem 0.75rem; gap: 0.4rem; }
  .nav-logo { font-size: 1rem; gap: 0.3rem; }
  /* Hide logo subtitle on mobile */
  .logo-subtitle { display: none; }
  /* Shrink logo image */
  #siteLogo { height: 40px !important; width: 40px !important; }
  /* Compress nav actions */
  .nav-actions { gap: 0.35rem; }
  /* Hide login button text on tiny screens */
  #loginNavBtn, #userNavBtn button {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.75rem !important;
  }
  .btn-cart, .cart-btn {
    padding: 0.4rem 0.6rem 0.4rem 0.55rem;
    font-size: 0.8rem;
    border-radius: 24px;
  }
  /* Hide the word "Cart" on tiny screens — keep icon + count */
  .cart-btn-label { display: none; }

  /* Search bar */
  #searchBar { padding: 0.6rem 0.75rem; }
  #searchInput {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  /* Search results grid — 2 columns on mobile */
  #searchResultsGrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  /* Hero */
  .hero { padding: 0.6rem 0.75rem; }

  /* Categories */
  .categories-section { padding: 1.75rem 0.75rem; }
  .category-card { padding: 1rem 0.5rem; }
  .category-emoji { font-size: 2.2rem; }
  .category-name { font-size: 0.82rem; }

  /* Products section */
  .products-section { padding: 1.25rem 0.6rem 2rem; }
  .products-grid { gap: 0.6rem; }

  /* Product card */
  .product-img-wrap { min-height: 130px; }
  .product-img-wrap img { height: 135px; }
  .product-card-body { padding: 0.55rem; gap: 0.2rem; }
  .product-name { font-size: 0.8rem; }
  .product-price { font-size: 1rem; }
  .product-unit { font-size: 0.68rem; }
  .btn-add-cart { font-size: 0.75rem; padding: 0.5rem 0.4rem; }
  .cooking-badge { font-size: 0.6rem; }

  /* Cart sidebar — full width on tiny screens */
  .cart-sidebar { width: 100% !important; }

  /* Subcategory tabs — smaller text */
  .tab-btn { font-size: 0.76rem; padding: 0.38rem 0.8rem; }

  /* Section headings */
  .section-header h2 { font-size: 1.3rem; }
  .products-category-title { font-size: 1.1rem; }
  .products-category-title .title-emoji { font-size: 1.5rem; }

  /* Footer */
  .footer-grid { gap: 1.5rem; }
  .footer-bar { flex-direction: column; text-align: center; gap: 0.25rem; }

  /* WhatsApp button — move up slightly so it doesn't hide cart/checkout */
  #waBtn { bottom: 1rem; right: 0.75rem; width: 48px; height: 48px; font-size: 1.4rem; }
}

/* ---- Medium phones: 481px–767px ---- */
@media (min-width: 481px) and (max-width: 767px) {
  .products-section { padding: 1.5rem 1rem 2.5rem; }
  .product-img-wrap img { height: 155px; }
  .product-img-wrap { min-height: 155px; }
  .cart-sidebar { width: 90% !important; }
}

/* ---- Reviews + how-it-works grids: fix minmax overflow on mobile ---- */
@media (max-width: 560px) {
  /* Reviews: force 1 column when minmax(260px) would overflow */
  [style*="minmax(260px"] {
    grid-template-columns: 1fr !important;
  }
  /* How it works: already minmax(160px) — 2 columns fine but add safe fallback */
  [style*="minmax(160px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ---- Product detail lightbox — mobile ---- */
@media (max-width: 600px) {
  /* Make overlay use flex so the inner panel sits naturally */
  #prodDetailOverlay {
    padding: 0.5rem !important;
    align-items: flex-start !important;
  }
  /* Inner panel */
  #prodDetailOverlay > div {
    border-radius: 14px !important;
    margin: 0 auto !important;
  }
  /* Image area shorter on small screens */
  #pdImage {
    height: 200px !important;
  }
  /* Content padding tighter */
  #pdImage + div,
  #prodDetailOverlay > div > div:last-child {
    padding: 0.9rem 1rem 1.1rem !important;
  }
}

/* ---- Tablet: 768px–1023px ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .cart-sidebar { width: 340px; }
}

/* ============================================================
   Product Detail — Image Slider
   ============================================================ */

.pd-slider-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  background: #f3f8f3;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
}

.pd-slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.pd-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f8f3;
  cursor: zoom-in;
}

.pd-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 10px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.pd-slide .pd-emoji {
  font-size: 5rem;
}

/* Arrows */
.pd-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}
.pd-arrow:hover { background: rgba(0,0,0,0.7); }
.pd-prev { left: 0.5rem; }
.pd-next { right: 0.5rem; }
.pd-arrow.hidden { display: none; }

/* Dots */
.pd-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}
.pd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: none;
  padding: 0;
}
.pd-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* Close & Zoom buttons */
.pd-close-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pd-zoom-btn {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-zoom-btn:hover { background: rgba(0,0,0,0.7); }

/* Thumbnails strip */
.pd-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  overflow-x: auto;
  background: #f8f8f8;
  scrollbar-width: none;
  min-height: 0;
}
.pd-thumbs:empty { display: none; }
.pd-thumbs::-webkit-scrollbar { display: none; }

.pd-thumb {
  flex: 0 0 56px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}
.pd-thumb.active { border-color: #2d8c4e; }
.pd-thumb:hover  { border-color: #aaa; }

@media (max-width: 480px) {
  .pd-slider-wrap { height: 220px; }
  .pd-arrow { width: 30px; height: 30px; font-size: 1.2rem; }
}