/* Wonda Luxe - Matched to dova.ng colour grading & setup */

:root {
  --primary: #FF6B00;
  --primary-dark: #E05E00;
  --primary-light: #FFF8F2;
  --orange-50: #fff7ed;
  --dark: #171717;
  --text: #171717;
  --muted: #6b7280;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --border: #fed7aa;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --radius: 16px;
  --radius-lg: 24px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--primary);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.75rem;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: #374151;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

.cart-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  transition: background 0.2s;
}

.cart-btn:hover {
  background: var(--primary-dark);
}

.cart-count {
  background: white;
  color: var(--primary);
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  position: absolute;
  top: -6px;
  right: -6px;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--primary-light) 0%, #fff 100%);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.8rem 1.75rem;
  border-radius: 12px;
  font-weight: 700;
  display: inline-block;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Products */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #fed7aa80;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.08);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f3f4f6;
}

.product-info {
  padding: 1rem;
}

.product-info h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--dark);
  line-height: 1.3;
}

.price {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
}

.add-to-cart {
  width: 100%;
  margin-top: 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.add-to-cart:hover {
  background: var(--primary-dark);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.75rem;
  cursor: pointer;
  background: none;
  border: none;
  color: #9ca3af;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background: var(--orange-50);
  color: var(--dark);
}

.modal-content img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: #f9fafb;
}

.ingredients {
  background: var(--primary-light);
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  margin-top: 0.75rem;
  color: #374151;
  line-height: 1.5;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: white;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  z-index: 1500;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

.cart-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  font-weight: 800;
  font-size: 1.15rem;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cart-item {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f6;
}

.cart-item-info {
  flex: 1;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.qty-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  background: white;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.whatsapp-checkout {
  width: 100%;
  background: #25D366;
  color: white;
  border: none;
  padding: 0.95rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.2s;
}

.whatsapp-checkout:hover {
  background: #1ebe57;
}

/* Footer */
footer {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25D366;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  z-index: 999;
}

/* Filters */
.filter-btn {
  margin: 0 0.35rem;
  padding: 0.45rem 1rem;
  border: 1.5px solid #e5e7eb;
  background: white;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  nav ul {
    gap: 1rem;
  }
  .hero h1 {
    font-size: 1.85rem;
  }
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
  }
  .product-card img {
    height: 150px;
  }
}

/* ---------- Fixes & additions ---------- */
.cart-count { display: none; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1400;
}
.overlay.active { display: block; }
.modal { z-index: 2000; background: transparent; }
.modal.active { background: transparent; }

.title-btn {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.title-btn:hover { color: var(--primary); }
.product-card img { cursor: pointer; }
.product-card:focus-within { box-shadow: 0 0 0 2px var(--primary); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.product-cat { color: #999; font-size: 0.85rem; margin-bottom: 0.3rem; }
.modal-desc { margin: 1rem 0; }
.modal-add { margin-top: 1.5rem; width: 100%; }
.cart-empty { text-align: center; color: #999; padding: 2rem; grid-column: 1 / -1; }
.cart-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.remove-item { margin-left: auto; color: red; border: none !important; background: none !important; }
.filters { text-align: center; margin-bottom: 2rem; }
.filter-btn { margin-bottom: 0.5rem; }
.footer-link { color: inherit; text-decoration: underline; }

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: #333; color: white; padding: 12px 24px; border-radius: 30px;
  z-index: 9999; animation: fadeInOut 2s forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  15%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 0); }
}
