/* ========================================
   GLOBAL THEME VARIABLES (Light & Dark)
   ======================================== */
:root {
  /* LIGHT MODE (Professional & Clean) */
  --bg: #f4f6f8;                  /* Light gray background */
  --panel: rgba(255, 255, 255, 0.9); /* Glassy white */
  --panel-solid: #ffffff;
  --panel-hover: rgba(241, 245, 249, 0.8);
  --text: #1e293b;                /* Dark ash text */
  --muted: #64748b;
  --accent: #0f3460;              /* Professional Dark Blue */
  --accent-hover: #1a4b8c;
  --danger: #ef4444;
  --success: #10b981;
  --border: rgba(0, 0, 0, 0.1);
  
  --nav-bg: rgba(15, 52, 96, 0.95); /* Solid dark blue header */
  --nav-text: #ffffff;
  --nav-muted: #cbd5e1;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  /* DARK MODE (Matte Dark Blue & Ash Glassy) */
  --bg: #0b1120;                  /* Deep dark blue background */
  --panel: rgba(30, 41, 59, 0.6);   /* Glassy panel background */
  --panel-solid: #1e293b;         /* Solid ash blue */
  --panel-hover: rgba(51, 65, 85, 0.8);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #3b82f6;              /* Clean matte blue */
  --accent-hover: #2563eb;
  --border: rgba(148, 163, 184, 0.15);
  
  --nav-bg: rgba(11, 17, 32, 0.95);
  --nav-text: #f8fafc;
  --nav-muted: #94a3b8;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* ========================================
   GLOBAL RESETS & TYPOGRAPHY
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg); 
  color: var(--text); 
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 5%; }
.section { padding: 4rem 0; }
.section-header { margin-bottom: 2rem; }
.section-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.25rem; }
.section-subtitle { font-size: 0.9rem; color: var(--muted); }
.main-content { margin-top: 90px; min-height: calc(100vh - 180px); }

/* ========================================
   GLOBAL COMPONENTS
   ======================================== */
/* Loader */
.loader { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s; }
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none;}
.loader-text { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  transition: background 0.3s ease;
}
.nav-container { display: flex; align-items: center; justify-content: space-between; max-width: 1700px; margin: 0 auto; padding: 0 5%; }
.logo-text { font-size: 1.4rem; font-weight: 800; color: var(--nav-text); letter-spacing: -0.5px; }
.nav-menu { display: flex; gap: 2rem; list-style: none; }
.nav-link { color: var(--nav-muted); font-weight: 500; font-size: 0.95rem; transition: 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--nav-text); }

/* Search Bar & Popup */
.nav-search {
  position: relative;
  display: flex; align-items: center; flex: 1; max-width: 500px; margin: 0 2rem;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 0.5rem 1rem; transition: 0.2s;
}
.nav-search:focus-within { border-color: #ffffff; background: rgba(255,255,255,0.15); }
.nav-search svg { width: 18px; height: 18px; color: var(--nav-muted); margin-right: 0.5rem; }
.nav-search input { background: transparent; border: none; color: #ffffff; width: 100%; outline: none; font-size: 0.95rem; }
.nav-search input::placeholder { color: var(--nav-muted); }

.search-popup {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-height: 400px; overflow-y: auto; z-index: 1001;
  display: none; flex-direction: column;
}
.search-popup.active { display: flex; }
.search-group-title { padding: 0.5rem 1rem; font-size: 0.75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; background: rgba(0,0,0,0.05); }
.search-item { padding: 0.75rem 1rem; display: flex; align-items: center; gap: 1rem; color: var(--text); transition: 0.2s; border-bottom: 1px solid var(--border); }
.search-item:hover { background: var(--panel-hover); }
.search-item img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--bg); }
.search-item-info { display: flex; flex-direction: column; }
.search-item-title { font-weight: 600; font-size: 0.9rem; }
.search-item-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem;}

/* Cart & Theme Icons */
.nav-icons { display: flex; align-items: center; gap: 1.5rem; }
.icon-btn { position: relative; color: var(--nav-text); transition: color 0.2s; display: flex; align-items: center; }
.icon-btn:hover { color: var(--nav-muted); }
.icon-btn svg { width: 22px; height: 22px; }
.cart-count { position: absolute; top: -8px; right: -10px; background: var(--danger); color: white; font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; border: 2px solid var(--nav-bg); }

/* Shared Product Cards */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.product-card {
  background: var(--panel);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.product-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.product-badges { position: absolute; top: 1rem; left: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 10; pointer-events: none;}
.badge-tag { padding: 0.25rem 0.6rem; font-size: 0.7rem; font-weight: 600; border-radius: 4px; text-transform: uppercase; background: var(--panel-solid); border: 1px solid var(--border); color: var(--text);}
.badge-sale { background: var(--danger); color: white; border: none; }
.badge-oos { background: var(--muted); color: white; border: none; }
.product-image { position: relative; aspect-ratio: 1/1; background: var(--bg); overflow: hidden; display: block; }
.prod-img-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: blur(15px); transform: scale(1.05); transition: 0.5s; z-index: 1; }
.prod-img-full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: 0.5s; z-index: 2; }
.product-info { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text); }
.product-category { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;}
.price-container { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; margin-top: auto; }
.price-regular { font-size: 1.15rem; font-weight: 700; color: var(--accent); margin-bottom: 1.25rem; margin-top: auto;}
.price-old { font-size: 0.85rem; color: var(--muted); text-decoration: line-through; }
.price-current { font-size: 1.15rem; font-weight: 700; color: var(--danger); }
.btn-cart { width: 100%; padding: 0.8rem; font-size: 0.9rem; font-weight: 600; background: var(--panel-solid); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-cart:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: white; }
.btn-cart:disabled { opacity: 0.5; cursor: not-allowed; }

/* Global Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--success); color: white; padding: 1rem 1.5rem; border-radius: var(--radius-sm); z-index: 9999; opacity: 0; transform: translateY(20px); transition: 0.3s; font-weight: 500; pointer-events: none;}
.toast.show { opacity: 1; transform: translateY(0); }

/* Footer */
.footer { background: var(--nav-bg); color: var(--nav-muted); padding: 3rem 0; border-top: 1px solid var(--border); text-align: center; font-size: 0.9rem; }

@media (max-width: 992px) {
  .nav-menu, .nav-search { display: none; }
}

/* ========================================
   NEW ADDITIONS & FIXES
   ======================================== */

/* Fix 5: Cart Icon Size Fix */
.btn-cart svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Fix 3: Nav Logo */
.nav-logo-img {
  height: 60px; 
  width: auto;
  object-fit: contain;
}

/* Fix 1: Popup Styles */
.offer-popup-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: center;
  z-index: 10000; opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.offer-popup-overlay.show {
  opacity: 1; visibility: visible;
}
.offer-popup-content {
  background: var(--bg); padding: 2.5rem; border-radius: var(--radius-lg);
  position: relative; max-width: 500px; width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5); border: 1px solid var(--border);
  transform: translateY(20px); transition: 0.3s ease;
}
.offer-popup-overlay.show .offer-popup-content { transform: translateY(0); }
.close-popup {
  position: absolute; top: 15px; right: 15px; font-size: 1.8rem;
  line-height: 1; background: none; border: none; cursor: pointer; color: var(--muted); transition: 0.2s;
}
.close-popup:hover { color: var(--danger); }

/* Fix 6: WhatsApp Button Styles */
.whatsapp-float {
  position: fixed; bottom: 30px; right: 30px;
  background-color: #25d366; color: white;
  width: 60px; height: 60px; border-radius: 50px;
  display: flex; justify-content: center; align-items: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 9999; transition: transform 0.3s ease, background-color 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); background-color: #1ebe57; color: white;}

/* --- Fix 3: Theme-based Hero Filters --- */
/* Default (Light Mode) - Lighter filter */
.hero-overlay { 
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(to bottom, rgba(11, 17, 32, 0.3) 0%, rgba(11, 17, 32, 0.1) 40%, rgba(11, 17, 32, 0.4) 100%);
  transition: background 0.3s ease;
}

/* Dark Mode Override - Darker filter */
[data-theme="dark"] .hero-overlay {
  background: linear-gradient(to bottom, rgba(11, 17, 32, 0.8) 0%, rgba(11, 17, 32, 0.5) 40%, rgba(11, 17, 32, 0.9) 100%);
}

/* --- Fix 4: Thinner Banners (Desktop vs Mobile) --- */
.parallax-banner {
  width: 100vw; 
  height: 25vh; /* Half as thick on desktop */
  min-height: 250px; 
  background-size: cover; 
  background-position: center; 
  background-attachment: fixed; 
  box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

/* Mobile: Much thinner (approx 1/5th of original) */
@media (max-width: 768px) {
  .parallax-banner {
    height: 10vh; 
    min-height: 120px;
    background-attachment: scroll; /* Note: Parallax is often buggy on mobile iOS, scroll is safer, but you can remove this line if you want to force fixed */
  }
}

/* ========================================
   GLOBAL OVERRIDES (Added for all pages)
   ======================================== */

/* 1. Light Blue Navbar & Black Text (Light Mode Default) */
:root {
  --nav-bg: rgba(219, 234, 254, 0.95) !important; 
  --nav-text: #000000 !important;                 
  --nav-muted: #334155 !important;                
}

/* 2. Dark Mode Navbar Colors (Forces Dark Mode to work) */
html[data-theme="dark"] {
  --nav-bg: rgba(11, 17, 32, 0.95) !important;
  --nav-text: #ffffff !important;
  --nav-muted: #94a3b8 !important;
}

/* 3. 50% Bigger Logo & Dark Mode Invert */
.nav-logo-img { 
  height: 50px !important; 
  width: auto !important; 
  object-fit: contain !important; 
  transform: scale(1.5) !important; 
  transform-origin: left center !important;
  transition: filter 0.3s ease !important;
}

html[data-theme="dark"] .nav-logo-img {
  filter: invert(1) !important;
}

/* 4. Mobile Layout Adjustments */
@media (max-width: 992px) {
  .nav-container { flex-wrap: wrap !important; }
  .nav-search { 
    display: flex !important;
    order: 3 !important; 
    flex: 0 0 100% !important; 
    max-width: 100% !important; 
    margin: 1rem 0 0 0 !important; 
  }
  
  /* Fixes the overlapping bug on mobile by pushing content down */
  .main-content > .section:first-child {
    padding-top: 6rem !important; 
  }
}

/* ========================================
   GLOBAL SHARE MODAL STYLES
   ======================================== */
.share-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 10005; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.share-modal-overlay.open { opacity: 1; visibility: visible; }
.share-modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; width: 90%; max-width: 400px; text-align: center; position: relative;
  transform: translateY(20px); transition: 0.3s ease; box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.share-modal-overlay.open .share-modal-box { transform: translateY(0); }
.close-share {
  position: absolute; top: 15px; right: 15px; font-size: 1.8rem; line-height: 1;
  background: none; border: none; cursor: pointer; color: var(--muted); transition: 0.2s;
}
.close-share:hover { color: var(--danger); }

/* ========================================
   AUTHENTICATION PAGE STYLES (auth.html)
   ======================================== */
.auth-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg), #0b1120); /* Sleek gradient background */
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  z-index: 10;
}

/* Smooth Fade-In Animation */
.auth-container.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.auth-container.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* The Glass-Morphism Card */
.auth-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 55px;
  height: 55px;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Form Inputs */
.auth-form .form-group {
  margin-bottom: 1.5rem;
}
.auth-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.auth-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: 0.2s;
}
.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn-full {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Google Button */
.btn-google {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-google:hover {
  background: var(--panel-hover);
  border-color: var(--muted);
}
.btn-google svg {
  width: 22px;
  height: 22px;
}

/* Dividers & Text */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.auth-divider span {
  padding: 0 10px;
}

.auth-toggle {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.toggle-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
  font-size: 0.9rem;
}
.toggle-btn:hover {
  text-decoration: underline;
}

/* Error/Success Messages */
.auth-message {
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: none;
  text-align: center;
}
.auth-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.auth-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Footer Positioning */
.auth-footer {
  position: relative;
  margin-top: 2rem;
  width: 100%;
  text-align: center;
  border: none;
  background: transparent;
  z-index: 1;
}
.auth-footer p { margin-bottom: 0.2rem; }
.auth-footer a { color: var(--accent); font-weight: 700; text-decoration: none; }