/* CSS Variables for consistency */
:root {
  /* === NEW: Brand Logo Color Palette === */
  --pink: #ef4444; /* A classic red for the favorite heart icon. Was #ff2d86 */
  --pink-dark: #e21f6d; /* active state for pink */

  --primary-dark: #00486d;  /* Deepest Blue from Logo */
  --primary-color: #01659a; /* Main Blue from Logo */
  --accent-color: #0bade2;  /* Bright Cyan from Logo */
  --primary-light: #e6f0f5; /* Light tint of primary blue */
  --text-primary: #263238;  /* Blue Grey 900 */
  --text-dark: #162029; /* For product name */
  --text-secondary: #546E7A;/* Blue Grey 600 */
  --border-color: #CFD8DC;  /* Blue Grey 100 */
  --bg-light: #ECEFF1;      /* Blue Grey 50 */
  --bg-white: #FFFFFF;
  --success-color: #388E3C; /* Green 700 */
  --error-color: #D32F2F;   /* Red 700 */

  /* NEW: Demo specific variables */
  --card-shadow: 0 6px 18px rgba(7,20,25,0.06);
  --card-radius: 12px;

  /* === Sizing & Layout === */
  --app-max-width: 480px;
  --header-padding: 8px 16px;
  --logo-height: 32px;
  --cart-badge-size: 22px;
  --carousel-height: 150px;
  --carousel-transition: 0.5s;
  --trust-icon-height: 44px;
  --tabs-icon-size: 20px;
  --grid-gap: 12px;
  --radius-card: 14px; --radius-img: 14px;
  --add-pill-padding: 7px 12px;
  --add-pill-font-size: 13px; /* UPDATED */
  --qty-btn-size: 26px;
  --qty-font-size: 15px; /* UPDATED */
  --price-now-font-size: 14px;
  --product-name-font-size: 12px;
  --search-padding: 10px 40px 10px 44px;
  --search-radius: 25px;
  --search-font-size: 15px;
  --floating-cart-bottom: 70px;
  --bottom-nav-height: 64px;
  --bottom-nav-btn-width: 64px;
  --bottom-nav-icon-size: 18px;
  --toast-bottom: 150px;
  --toast-animation: 1800ms;
}

/* NEW: Communication Carousel styles */
.communication-carousel {
  margin: 0; /* Removed margin as it's now inside a .section */
  overflow: hidden;
  border-radius: 16px; /* Bolder radius for card style */
  position: relative;
  height: 66px; /* Mobile height */
  box-shadow: 0 6px 20px rgba(0,0,0,0.1); /* Enhanced shadow */
  background-color: #0B1A4A; /* Dark blue fallback */
}

/* --- REVAMPED: Login Modal Styles (based on new design) --- */
.login-modal {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: 100%;
  background: var(--bg-light);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-modal.active {
  display: flex;
}

.login-modal .login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
  padding: 28px 22px;
  position: relative;
}

.login-modal .back-btn {
  position: absolute;
  top: 10px;
  left: 10px;
}

.login-modal .title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: #0f3642;
}

.login-modal .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

.login-form {
  display: none;
}

.login-form.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-modal label {
  font-size: 13px;
  color: #475b62;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.login-modal .input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e6eef1;
  background: #fbfeff;
  font-size: 15px;
  outline: none;
}

/* NEW: Class to hide content visually but keep it for SEO/screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-modal .input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 6px 18px rgba(10,119,166,0.08);
}

.login-modal .cta {
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(6,102,143,0.12);
}

.login-modal .row {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-modal .row a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.login-modal .or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.login-modal .hr {
  flex: 1;
  height: 1px;
  background: #e8f0f3;
  border-radius: 2px;
}

.login-modal .socials {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.login-modal .social-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e6eef1;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-modal .google { color: #DB4437; }
.login-modal .facebook { color: #4267B2; }

.login-modal .social-btn .fab {
  font-size: 18px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* FIX: Ensure body and html fill the viewport to prevent white gaps on mobile */
html { height: 100%; }

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

/* App wrapper with max-width constraint */
.app {
  max-width: var(--app-max-width);
  margin: 0 auto;
  background: var(--bg-white);
  min-height: 100%;
  box-shadow: 0 0 50px rgba(0,0,0,0.1);
  position: relative;
  overflow-x: hidden;
}

.page {
  display: none;
  padding-bottom: 120px;
}

.page.active {
  display: block;
}

/* Desktop background */
@media (min-width: 481px) {
  body {
    background-image: url('https://res.cloudinary.com/dpyniai9l/image/upload/v1758106311/Coastalfresh_website_Background_nkpuzo.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
  }
  
  .app {
    border-radius: 20px;
    overflow: hidden;
    /* FIX: Move padding from body to .app to avoid affecting fixed elements */
    margin: 20px auto;
  }
}

/* Ticker - Now above header */
.ticker-container {
  position: sticky;
  top: 0;
  z-index: 102;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-color)); /* Updated Gradient */
  color: var(--bg-white); padding: 6px 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ticker {
  display: flex;
  white-space: nowrap; animation: ticker-scroll 15s linear infinite;
}

.ticker-item {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 500;
}

.ticker-item i {
  margin-right: 8px;
  font-size: 13px;
}

.ticker-container:hover .ticker {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Header */
.header {
  background: var(--bg-white);
  padding: var(--header-padding);
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 30px; /* Adjusted for smaller ticker */
  z-index: 101;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* OPTIMIZATION: Compact header for modals */
.cart-modal .header,
.product-popup .header {
  top: 0;
}

.cart-modal .header .header-top {
  margin-bottom: 0; /* No search bar, so no margin needed */
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* NEW: Generic class for modal/page headers with a back button */
.modal-header-main {
  justify-content: flex-start;
  gap: 8px; /* Add a small gap between back button and title */
}

/* --- FIX: Push cart button to the right on catalog page --- */
#catalog .cart-btn {
  margin-left: auto;
}
/* --- End of Fix --- */

.back-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--primary-color);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center; justify-content: center;
  transition: background-color 0.2s;
}

.back-btn:active {
  background-color: var(--primary-light);
}

/* NEW: Ensure h1 used as logo has correct styling */
h1.logo {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.logo {
  font-size: 18px;
  font-weight: 600; /* UPDATED */
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: var(--logo-height);
  width: auto;
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--primary-color);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex; align-items: center;
  justify-content: center; 
  transition: background-color 0.2s;
}

.cart-btn:active {
  background-color: var(--primary-light);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error-color);
  color: white;
  border-radius: 50%;
  width: var(--cart-badge-size);
  height: var(--cart-badge-size);
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-white);
}

.title {
  font-size: 28px;
  font-weight: 600; /* UPDATED */
  color: var(--text-primary);
  margin-bottom: 6px;
  text-align: center;
}

.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 15px;
  text-align: center;
}

.search-container {
  position: relative;
}

.search {
  background: var(--bg-light);
  border: none;
  border-radius: var(--search-radius);
  padding: var(--search-padding);
  font-size: var(--search-font-size);
  width: 100%;
  color: var(--text-primary);
  transition: all 0.2s;
}

.search:focus {
  outline: none;
  background: var(--border-color);
  box-shadow: 0 0 2px rgba(1, 101, 154, 0.3); /* Shadow to match new primary color */
}

.search::placeholder {
  color: var(--text-secondary);
}

.search-icon {
position: absolute;
left: 15px;                 /* nudge icon a little inward; adjust if needed */
top: 50%;
transform: translateY(-50%);
color: var(--text-secondary);
font-size: 15px;
pointer-events: none;       /* so clicks go through to the input */
z-index: 2;                 /* sits above input content */
}

/* Section */
.section {
  padding: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1A1A1A;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* NEW: Wrapper for section title text and icon */
.section-title-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-all {
  font-size: 14px;
  color: var(--accent-color);
  font-weight: 500;
}

/* Carousel */
.carousel {
  margin: 0 20px 32px;
  overflow: hidden;
  border-radius: 16px;
  position: relative;
  height: var(--carousel-height);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  /* NEW: Enable horizontal scrolling */
  overflow-x: auto;
  /* NEW: Hide scrollbar across browsers */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  /* NEW: Enable CSS Scroll Snap */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.slides {
  display: flex;
  transition: transform var(--carousel-transition) ease;
  height: 100%;
}

.slide {
  min-width: 100%;
  height: 100%;
  /* NEW: Define snap points for each slide */
  scroll-snap-align: start;
  position: relative;
}

.slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  position: absolute; /* Position relative to the .carousel container */
  bottom: 10px; /* Position it inside the carousel */
  left: 50%;
  transform: translateX(-50%); /* Center the dots horizontally */
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transition: all 0.3s;
}

.dot.active {
  width: 16px;
  border-radius: 8px;
  background: white;
}

/* Trust Icons */
.trust-strip {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background: transparent; /* Remove background to let items define it */
  border-radius: 12px;
  padding: 0; /* Remove padding from container */
  gap: 8px; /* Adjust gap between items */
  box-shadow: none;
  border: none;
  position: relative;
  overflow: hidden;
  margin: 0 20px 32px; /* Increased bottom margin */
}

.trust-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px; /* Tighter gap between icon and text */
  text-align: center;      
  padding: 8px 4px;
  background: var(--bg-white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-radius: 12px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}

.trust-item:active {
  transform: scale(0.97);
}

.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; /* Smaller icon container */
  height: 32px;
  border-radius: 12px;
  font-size: 14px; /* Smaller icon */
  margin-bottom: 2px;
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  color: var(--bg-white);
  border: none; /* Cleaner look */
}

.trust-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap; /* FIX: Prevent title from breaking */
}

.trust-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap; /* FIX: Prevent subtitle from breaking */
}

/* --- NEW: Flash Sale Section --- */
.flash-sale-section {
  background: linear-gradient(175deg, var(--primary-light), var(--bg-white));
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0 24px;
  margin-bottom: 0; /* Divider will handle spacing */
}

/* NEW: Header to align title and timer on one line */
.flash-sale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 16px;
}

/* NEW: Countdown Timer Styles */
.flash-sale-timer {
  display: flex;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.5);
  padding: 6px 8px;
  border-radius: 8px;
  flex-shrink: 0; /* FIX: Prevent the timer from shrinking on small screens */
}

.timer-block {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.timer-num {
  background: var(--primary-dark);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
  animation: tick 1s infinite; /* Subtle tick animation */
}

.timer-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-dark);
}

.timer-ended {
  font-size: 14px;
  font-weight: 600;
  color: var(--error-color);
}

.flash-sale-section .section-title {
  padding: 0; /* Reset padding */ /* This is an H1 */
  margin-bottom: 0; /* Reset margin */
  font-size: 18px;
  font-weight: 700; /* Bolder for impact */
  justify-content: flex-start; /* Align left */
  /* NEW: Prevent wrapping and handle overflow */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1; /* Allow title to shrink if needed */
  gap: 10px; /* Space between icon and text */
}

.flash-sale-products {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 20px 12px;
  scrollbar-width: none; /* Firefox */
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.flash-sale-products::-webkit-scrollbar { display: none; }
.flash-sale-products .product { flex: 0 0 45%; max-width: 180px; }

/* --- NEW: Flash Sale Product Card Overrides --- */
.flash-sale-item .product-image {
  background: #f7f9fa; /* Lighter background for contain */
}

.flash-sale-item .product-image img {
  object-fit: cover; /* Use cover to fill the space */
}

/* Bigger, more vibrant offer badge for flash sale */
.flash-sale-item .offer-badge {
  background: var(--success-color);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 16px;
}

/* Flash sale specific pricing */
.flash-sale-item .product-price .price {
  color: var(--success-color);
  font-weight: 700;
}

.flash-sale-item .product-price .old-price {
  color: var(--error-color);
}

/* --- NEW: Customer Reviews Section --- */
.reviews-section {
  background: var(--bg-light); /* Subtle grey background */
  padding-top: 24px;
  padding-bottom: 24px;
}

.reviews-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 20px 20px 20px; /* Padding to show shadow and for scrollbar */
  margin: 0 -20px; /* Negative margin to allow full-width scroll */
  scrollbar-width: none; /* For Firefox */
  -ms-overflow-style: none; /* For IE/Edge */
}

.reviews-carousel::-webkit-scrollbar {
  display: none; /* For Chrome, Safari, and Opera */
}

.review-card {
  flex: 0 0 80%; /* Each card takes up 80% of the viewport width */
  max-width: 300px; /* Max width on larger screens */
  background: var(--bg-white);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08); /* Enhanced shadow */
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-snap-align: start;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.review-avatar-initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
}

.review-name {
  font-weight: 600; /* UPDATED */
  font-size: 15px;
}

.review-location {
  font-size: 13px;
  color: var(--text-secondary);
}

.review-rating .fa-star {
  color: #FFB000; /* Gold color for stars */
  font-size: 14px;
}

.review-body {
  font-size: 13px; /* UPDATED */
  line-height: 1.5; /* UPDATED */
  color: var(--text-secondary);
  font-style: italic;
}

/* Home Featured Products */
.featured-section {
  padding-bottom: 24px;
}

/* REVERTED: Featured products now use horizontal scroll like flash sale - FIX */
.featured-products {
  display: flex;
  gap: var(--grid-gap);
  overflow-x: auto;
  padding: 4px 20px 12px;
  margin: 0 -20px; /* Use negative margin to break out of parent padding */
  scrollbar-width: none; /* Firefox */
}

.featured-products .product { flex: 0 0 45%; max-width: 180px; }

/* Categories for Catalog */
.categories {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 5px 0 15px;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category {
  background: var(--bg-light); /* UPDATED */
  border: none; /* UPDATED */
  border-radius: 20px; /* UPDATED */
  padding: 8px 16px; /* UPDATED */
  font-size: 14px; /* UPDATED */
  font-weight: 500; /* UPDATED */
  color: var(--text-secondary); /* UPDATED */
  white-space: nowrap; /* UPDATED */
  cursor: pointer; /* UPDATED */
  transition: all 0.2s; /* UPDATED */
  flex-shrink: 0; /* UPDATED */
  display: flex; /* NEW */
  align-items: center; /* NEW */
  gap: 8px; /* NEW */
}

/* NEW: Icon inside category button */
.category-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  transition: filter 0.2s ease; /* NEW: Smooth transition for icon color */
}

.category.active {
  background: var(--accent-color); /* Use bright accent for active category */
  color: var(--bg-white);
  font-weight: 700;
}

/* NEW: Make icon white on active category */
.category.active .category-icon {
  filter: brightness(0) invert(1);
}

/* Products Grid */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

/* --- DEFINITIVE FIX: Product Card Styles from Demo (Blinkit/Zepto style) --- */
.card.product {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 12px;
  background: #fff;
  position: relative;
  transition: transform 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

/* NEW: Style for unavailable product cards */
.card.product.unavailable {
  cursor: not-allowed;
  opacity: 0.8; /* Slightly fade out the card */
}

.card.product:hover {
  transform: translateY(-4px);
}

/* Image area */
.product-image {
  position: relative;
  text-align: center;
}

.product-image img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* Wishlist button */
.wish {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* NEW: Notify Me button for out-of-stock items */
.notify-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--primary-color); /* Using theme blue */
  color: #fff;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.2s;
  z-index: 2;
  display: flex;
}

/* ADD button inside image bottom-right */
.add-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--success-color); /* Using theme green */
  color: #fff;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.2s;
  z-index: 2;
}

.add-btn:hover {
  filter: brightness(1.1);
}

/* NEW: Style for the "SELECT" button on multi-variant products */
.select-btn {
  font-size: 12px; /* Smaller font size as requested */
  padding: 6px 10px; /* Adjust padding to be more compact */
  background: var(--primary-color); /* Use primary color for consistency */
}

/* Quantity controls that replace the ADD button */
.cart-controls {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  background: var(--success-color);
  color: white;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 2;
  height: 29px; /* Match add-btn height */
}

.cart-controls .qty-btn {
  background: none;
  border: none;
  width: 28px;
  height: 29px;
  color: white;
  font-size: 16px;
  cursor: pointer;
}
.cart-controls .qty {
  font-size: 13px;
  min-width: 20px;
  text-align: center;
}

/* Product Info */
.info {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px; /* Small gap between elements */
}

.name {
  font-size: 14px;
  font-weight: 500;
  color: #111;
  margin: 0;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.final-price {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.old-price {
  text-decoration: line-through;
  font-size: 13px;
  color: #999;
}

.save {
  font-size: 13px;
  color: green;
  font-weight: 500;
}

.out-of-stock-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--error-color);
  margin-top: 8px;
}

/* Out of Stock Overlay on image */
.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--error-color);
  font-weight: 700;
  font-size: 14px;
  backdrop-filter: blur(1px);
}

/* Product-popup this ENTIRE block */
.product-popup {
position: fixed;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: var(--app-max-width);
height: 100%; /* FIX: Use 100% instead of 100vh to respect mobile browser UI */
background: var(--bg-white);
z-index: 1000;
display: none; /* Changed from flex to allow self-scrolling */
flex-direction: column;
overflow: hidden;
}

/* For desktop - keep it centered and constrained */
@media (min-width: 481px) {
.product-popup {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100vh;
  max-width: var(--app-max-width);
  border-radius: 0;
  box-shadow: 0 0 50px rgba(0,0,0,0.2);
}
}


.product-popup.active {
  display: flex;
}

/* Updated popup header to match new design */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--header-padding);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  flex-shrink: 0; /* Prevent header from shrinking */
}

.popup-header-actions {
  display: flex;
  gap: 8px; /* Space between favorite and share icons */
}

.popup-action-btn {
  width: 36px; /* Larger touch target */
  height: 36px; /* Larger touch target */
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px; /* Larger icon */
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.popup-action-btn:active {
  background-color: var(--primary-light);
}

/* Product Image Section */
.popup-image-section {
  position: relative;
  background: var(--bg-white);
  padding: 16px 20px;
}

.popup-image-container {
  position: relative;
  width: 100%;
  height: 200px; /* Further reduced height for a more compact look */
  background: var(--bg-light);
  border-radius: var(--radius-img);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-img);
}

.popup-image-nav {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

.popup-image-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.popup-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ddd;
}

.popup-indicator.active {
  background: #333;
}

/* Product Info */
.popup-info {
  padding: 12px 20px 20px; /* Reduced top padding */
  background: var(--bg-white);
}

/* NEW: Grouped meta info below price */
.popup-meta-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: 12px;
}

.popup-delivery-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
}

.popup-delivery-time strong {
  font-weight: 600;
}

.popup-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.popup-stars {
  color: #FFB000;
  font-size: 14px;
}

.popup-rating-text {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.popup-title {
  font-size: 20px; /* H1 Title */
  font-weight: 700; /* UPDATED */
  margin-bottom: 4px;
  color: var(--text-primary);
}

/* NEW: Card-style variant selector */
.popup-weight { /* This container now holds the variant cards */
  display: flex;
  /* FIX: Ensure variants stay in a single row with horizontal scrolling on mobile */
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  margin-bottom: 16px;
  /* Add some padding to avoid scrollbar cutting off content */
  padding-bottom: 8px;
  /* Hide the scrollbar for a cleaner look */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}
.popup-weight::-webkit-scrollbar {
  display: none; /* Chrome, Safari, and Opera */
}

.variant-card {
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--bg-white);
}

.variant-card .variant-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.variant-card.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}
.variant-card.active .variant-name {
  color: var(--primary-dark);
  font-weight: 700;
}
/* NEW: Description with toggle */
.popup-description-container {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.popup-description-short {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-description-toggle {
  color: var(--primary-color);
  font-weight: 500;
  cursor: pointer;
  display: inline-block; /* To allow margin-top */
}

.popup-price-section {
  display: flex; 
  align-items: baseline; /* Align by baseline for different font sizes */
  gap: 8px;
  margin-bottom: 4px; /* Reduced margin */
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

/* NEW: Price presentation styles */
.popup-price-final { font-size: 24px; font-weight: 600; color: var(--text-primary); }
.popup-price-mrp { font-size: 16px; color: var(--text-secondary); text-decoration: line-through; opacity: 0.7; }
.popup-price-savings-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--success-color);
  background-color: #e8f5e9; /* Light green background */
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--success-color);
}

.popup-details-btn {
  color: var(--success-color);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
}

.popup-feature {
  text-align: center;
  flex: 1;
}

.popup-feature-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.popup-feature-title {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
}

.popup-feature-subtitle {
  font-size: 10px;
  color: var(--text-secondary);
}

/* NEW: Product Highlights Section */
.popup-highlights {
  display: flex;
  justify-content: space-around;
  padding: 16px 20px;
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
}

.highlight-item {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

/* --- Product Details Accordion --- */
.popup-details-section {
  padding: 0 20px;
  background: var(--bg-white);
}

.detail-item {
  border-top: 1px solid var(--border-color);
}

.detail-item:last-child {
  border-bottom: 1px solid var(--border-color);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 0;
}

/* Ensure Product Details content is always visible */
#productInfoDetailItem .detail-content {
  max-height: none !important; /* Override max-height transition */
  overflow: visible !important; /* Ensure content is not hidden */
  padding: 0 0 16px 0 !important; /* Always show padding */
}

/* Highlights Section */
.popup-highlights-section {
  padding: 16px 20px;
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
}

.popup-highlights-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 12px 0;
  transition: background-color 0.2s;
}

.popup-highlights-title {
  font-size: 18px;
  font-weight: 600; /* UPDATED */
}

.popup-expand-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: transform 0.3s;
}

.popup-highlights-content {
  padding-top: 0;
  display: none; /* Hidden by default */
}

.popup-highlight-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.popup-highlight-item:last-child {
  border-bottom: none;
}

.popup-highlight-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
}

.popup-highlight-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
}

/* NEW: Make content wrapper scrollable */
.popup-content-wrapper {
  flex: 1; /* Allow this to grow and fill space */
  overflow-y: auto; /* Enable vertical scrolling for the main content */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  width: 100%;
  /* STICKY FOOTER: Add padding to prevent content from being hidden by the fixed footer */
  padding-bottom: 100px; /* Default padding, JS will adjust it */
}

/* --- NEW: Sticky Product Page CTA --- */
.popup-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  background: var(--bg-white);
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  z-index: 1001;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, opacity 0.3s ease;
  /* Respect safe area for iPhone home indicator */
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* Hide CTA when keyboard is open */
.popup-sticky-cta.keyboard-open {
  transform: translateX(-50%) translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.popup-sticky-cta-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.popup-cta-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.popup-cta-add-btn {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  flex-grow: 1;
  box-shadow: 0 4px 12px rgba(56, 142, 60, 0.4);
}
.popup-cta-add-btn:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

/* NEW: Styles for the "View Cart" button and layout in the sticky CTA */
.popup-cta-left {
  flex-grow: 1;
}
.popup-cta-right {
  flex-shrink: 0;
}
.popup-cta-view-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(1, 101, 154, 0.3);
  position: relative; /* For badge positioning */
}
.popup-cta-view-cart .cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error-color);
  border-radius: 50%;
  width: 22px; height: 22px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-white);
}

.popup-cta-add-btn:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

/* --- NEW: Quantity Selector for Sticky CTA --- */
.popup-cta-qty-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
}

.popup-cta-qty-selector .qty-btn {
  background: var(--bg-white);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  font-weight: 400;
  color: var(--primary-color);
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.popup-cta-qty-selector .qty-btn:active {
  transform: scale(0.95);
  background-color: var(--primary-light);
}

.popup-cta-qty-selector .qty {
  font-weight: 700;
  font-size: 16px;
  min-width: 24px;
  text-align: center;
  color: var(--text-primary);
}
.popup-cta-add-btn {
  margin-left: auto; /* Push the add button to the right */
}

/* --- REVAMPED CART PAGE STYLES --- */
.cart-modal {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: 100%;
  background: var(--bg-light);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.cart-modal.active { display: flex; }

.cart-content-wrapper {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#cartModal .header .logo {
  font-size: 20px;
  font-weight: 700;
}

/* Product list */
.cart-products { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px; }
.cart-item-card {
  display: flex;
  gap: 12px;
  background: var(--bg-white);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.08);
  align-items: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  overflow: hidden; /* Keep this to respect border-radius on children */
  min-height: 88px; /* NEW: Ensure a consistent minimum height for all cards */
}
.cart-item-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg-light);
  flex-shrink: 0; /* NEW: Prevent image from shrinking */
}
.cart-item-meta {
  flex: 1;
  display: flex; /* NEW: Use flexbox for vertical alignment */
  flex-direction: column; /* NEW: Stack name and price vertically */
  justify-content: center; /* NEW: Center content vertically */
  min-width: 0; /* NEW: Prevent text overflow issues */
}
.cart-item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px; /* NEW: Space between name and price */
}
.cart-item-price { font-weight: 700; margin-top: 8px; }
.cart-item-mrp {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: line-through;
  font-weight: 600;
  margin-left: 8px;
}
.cart-item-qty {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; /* NEW: Prevent quantity controls from shrinking */
}
.cart-item-qty .qty-btn { width: 36px; height: 36px; border-radius: 18px; border: 0; background: #f1f5f9; font-size: 18px; cursor: pointer; }
.cart-item-qty .count {
  min-width: 24px; /* NEW: Reduced min-width for a more compact look */
  text-align: center; font-weight: 500;
}
.cart-item-card.removing {
  opacity: 0;
  transform: translateX(50px) scale(0.9);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
}

/* Progress bar */
.cart-progress-wrap { margin: 14px 0; }
.cart-progress-card {
  background: var(--bg-white);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.08);
}
.cart-progress-text { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.cart-bar {
  height: 8px;
  background: #e6eef0;
  border-radius: 999px;
  overflow: hidden;
}
.cart-bar-inner {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #6bbf7b);
  transition: width 0.5s ease-in-out;
}

/* Bill details */
.cart-bill { background: var(--bg-white); padding: 16px; border-radius: 14px; box-shadow: 0 6px 18px rgba(15,23,42,0.08); margin: 10px 0; }
.cart-bill-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef2f3; font-size: 14px; }
.cart-bill-row:last-of-type { border-bottom: none; }
.cart-bill-row.total { border-bottom: none; font-weight: 700; font-size: 18px; }
.cart-saved { background: #ecf9ef; color: #0b6a2a; padding: 10px; border-radius: 8px; margin-top: 12px; font-weight: 500; }

/* Coupon */
.cart-coupon-wrap { display: flex; gap: 8px; margin: 12px 0; }
.cart-coupon { flex: 1; display: flex; align-items: center; background: var(--bg-white); padding: 10px; border-radius: 999px; box-shadow: 0 6px 18px rgba(15,23,42,0.08); }
.cart-coupon input { border: 0; background: transparent; outline: none; font-size: 15px; width: 100%; }
.cart-coupon-apply-btn { background: transparent; border-radius: 12px; border: 0; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.cart-coupon-applied-card {
  background: #e8f5e9; border: 1px solid var(--success-color); border-radius: 12px; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; margin: 12px 0;
}
.cart-coupon-applied-info { display: flex; align-items: center; gap: 12px; color: var(--success-color); }
.cart-coupon-applied-info .fa-check-circle { font-size: 20px; }
.cart-coupon-applied-info div { display: flex; flex-direction: column; }
.cart-coupon-applied-info strong { font-size: 14px; font-weight: 700; }
.cart-coupon-applied-info small { font-size: 12px; }
.cart-coupon-remove-btn { background: none; border: none; font-size: 24px; color: var(--success-color); cursor: pointer; opacity: 0.7; }
.cart-coupon-error { color: var(--error-color); font-size: 13px; margin-top: 8px; padding-left: 8px; }

/* Payment options */
.cart-payments { background: var(--bg-white); padding: 8px; border-radius: 12px; box-shadow: 0 6px 18px rgba(15,23,42,0.08); margin-bottom: 10px; }
.cart-pay-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
.cart-pay-item + .cart-pay-item { margin-top: 8px; }
.cart-pay-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.cart-pay-item.active { background-color: var(--primary-light); }
.cart-pay-label { font-weight: 600; }
.cart-pay-sub { color: var(--text-secondary); font-size: 13px; }

/* Sticky CTA */
.cart-sticky-ctawrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 12px)); /* FIX: Add safe area padding */
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  z-index: 1001;
}
.cart-cta.checkout-btn {
  width: 100%;
  max-width: var(--app-max-width);
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent), var(--accent-600));
  color: white;
  font-weight: 800;
  border: 0;
  box-shadow: 0 10px 30px rgba(20,83,45,0.18);
  font-size: 17px;
  cursor: pointer;
}
.cart-cta:active { transform: translateY(1px); }

/* --- END REVAMPED CART STYLES --- */

/* Old cart footer - to be removed */
.cart-footer {
position: fixed;
bottom: 0; /* Stick to the absolute bottom */
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: var(--app-max-width); /* FIX: Ensure footer background is consistent */
z-index: 1001;
background: var(--bg-white);
box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
border-top: 1px solid var(--border-color);
display: flex;
flex-direction: column; /* FIX: Corrected property */
gap: 16px; /* FIX: Increase vertical spacing between footer elements */
/* Add safe area padding here */ /* FIX: Make the entire footer background light grey */
padding: 10px 16px; /* REFINED: Adjusted padding */
padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* REFINED: Adjusted padding */
}

/* --- REVAMPED: Empty Cart Styles --- */
.empty-cart {
  text-align: center;
  padding: 28px 20px 120px; /* Padding for content and sticky footer */
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  gap: 18px;
}

.empty-cart .illustration {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(1,101,154,0.06), rgba(1,101,154,0.02));
  box-shadow: 0 6px 18px rgba(2,6,23,0.08);
  padding: 18px;
}

.empty-cart-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.1px;
  margin-bottom: 8px;
}

.empty-cart-lead {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
  max-width: 360px;
}

.cart-cta.empty-cart-btn {
  width: 100%;
  max-width: var(--app-max-width);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(1,101,154,0.18);
  transition: transform .12s ease, box-shadow .12s ease;
}

/* NEW: More prominent style for specific empty state buttons */
.empty-cart-btn.prominent {
  background: var(--success-color);
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(56, 142, 60, 0.3);
  border-radius: 14px;
  margin-top: 16px; /* Add some space above the button */
  max-width: 280px; /* Constrain width for a more button-like feel */
}
/* --- End of Revamped Styles --- */

/* FAQ */
.faq-wrap {
  padding: 20px;
}

.faq-header {
  text-align: center;
  margin-bottom: 30px;
}

.faq-header .section-title {
  justify-content: center;
  font-size: 24px;
}

.faq-header .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

.faq {
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.faq:last-child {
  border-bottom: none;
}

.q {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.faq.active .q {
  font-weight: 600; /* UPDATED */
  color: var(--primary-color);
}

.q .fa-chevron-down {
  transition: transform 0.3s ease;
  color: #c7c7cc;
}

.a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq.active .a {
  max-height: 500px;
}

.answer-highlight {
  background: var(--primary-light);
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 10px;
  font-weight: 500;
  color: var(--primary-dark);
}

.answer-content {
  padding: 0 0 20px 0;
  font-size: 14px; /* UPDATED */
  line-height: 1.5; /* UPDATED */
  color: var(--text-secondary);
}

/* --- NEW: Enhanced Profile Page Styles --- */
.profile-header-simple {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-white);
}

.profile-avatar-small {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary-color);
  border: 2px solid var(--primary-color); /* H2 Product Name style */
}

.profile-user-info h2 { font-size: 16px; font-weight: 500; }
.profile-user-info p { font-size: 13px; color: var(--text-secondary); }

.profile-divider {
  height: 8px;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 0 -20px; /* Extend divider to screen edges */
}

/* NEW: About Us Accordion Styles */
.about-details-section {
  margin-bottom: 24px;
  text-align: left;
}
.about-details-section .detail-item {
  border-top: 1px solid var(--border-color);
}
.about-details-section .detail-item:last-child {
  border-bottom: 1px solid var(--border-color);
}
.about-details-section .about-text {
  margin-bottom: 0; /* Remove bottom margin inside accordion */
}
.about-details-section .about-text + .about-text {
  margin-top: 16px; /* Add margin between paragraphs */
}

/* NEW: About Us Page Styles */
.about-us-content {
  padding-top: 16px; /* Add some top padding inside the container */
  text-align: center;
  padding-bottom: 16px;
}
.about-subtitle {
  font-size: 16px; /* Reduced font size */
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 20px; /* Reduced top margin */
  margin-bottom: 8px; /* Reduced bottom margin */
}
.about-text {
  font-size: 14px; /* Reduced font size */
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 12px; /* Reduced bottom margin */
}
.about-values {
  display: flex;
  gap: 16px;
  margin-top: 16px; /* Reduced top margin */
  justify-content: space-around;
}
.value-item {
  flex: 1;
  max-width: 120px;
}
.value-item i { font-size: 24px; color: var(--accent-color); margin-bottom: 8px; }
.value-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.value-item p { font-size: 13px; color: var(--text-secondary); }
/* NEW: About Us CTA Button */
.about-cta-container {
  margin-top: 24px; /* Reduced top margin */
  padding-top: 16px; /* Reduced top padding */
  border-top: 1px solid var(--border-color);
}
.about-cta-container p {
  font-size: 15px; /* Reduced font size */
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px; /* Reduced bottom margin */
}
.about-cta-btn {
  background: var(--primary-color);
  color: white;
  border: none; border-radius: 12px; padding: 14px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(1, 101, 154, 0.3); display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* NEW: Styles for social media section on About Us page */
.about-socials-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.social-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-socials-section .social-bar {
  justify-content: center;
}

/* --- NEW: Enhanced Refer & Earn Page Styles --- */
.refer-hero {
  background: linear-gradient(180deg, var(--primary-light), var(--bg-white));
  border-radius: 16px;
  margin-bottom: 16px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  margin: 0 16px 16px; /* Adjust margin to be consistent */
}
.refer-hero-icon {
  width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(var(--primary-light), var(--bg-white));
  box-shadow: 0 12px 30px rgba(1, 101, 154, 0.08); margin-bottom: 16px;
  font-size: 40px; color: var(--primary-color);
}
.refer-title { font-size: 20px; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.refer-subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0; }
.refer-subtitle strong { color: var(--primary-dark); }
 
/* --- NEW: Centered Share Actions Container --- */
.refer-actions-container {
  display: flex;
  flex-direction: column; /* NEW: Stack items vertically */
  gap: 12px;
  align-items: center;
  margin: 0 16px 16px;
  padding: 12px;
  border-radius: 12px;
}

.refer-link-container {
  flex-grow: 1; display: flex; align-items: center; gap: 10px;
  background: var(--bg-light); border: 1px dashed var(--border-color);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
/* NEW: Ensure link container takes full width */
.refer-actions-container .refer-link-container {
  width: 100%;
}

.refer-link { font-weight: 600; color: var(--primary-color); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refer-link-container i { color: var(--text-secondary); }

.share-btn {
  padding: 14px; border-radius: 12px; border: none; font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.2s;
}
.share-btn.whatsapp { background: #25D366; color: white; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); }
.share-btn.other-apps { background: var(--primary-color); color: white; box-shadow: 0 4px 12px rgba(1, 101, 154, 0.3); }
.share-btn:active { transform: scale(0.98); }

/* NEW: Container for the two share buttons */
.refer-share-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* NEW: Make each button take 50% width */
.refer-share-buttons .share-btn {
  flex: 1 1 50%;
}

/* NEW: Login prompt styles for refer page */
.refer-login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--primary-light);
  border: 1px dashed var(--primary-color);
  border-radius: 12px;
  padding: 20px;
  margin: 0 16px 16px;
}
.refer-login-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-dark);
}
.refer-login-btn {
  background: var(--primary-color);
  color: white;
  border: none; border-radius: 10px; padding: 12px 24px; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(1, 101, 154, 0.3);
}

/* How it Works Section */
.refer-steps-section {
  margin: 0 16px 16px;
  background: var(--bg-white);
  border-radius: 16px;
  padding: 16px;
  border: 1px dashed var(--border-color);
}
.refer-steps-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.refer-steps-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.refer-terms-btn {
  background: var(--bg-light); color: var(--text-secondary); border: 1px solid var(--border-color);
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13px;
}
.refer-step { display: flex; gap: 16px; align-items: flex-start; }
.refer-step + .refer-step { margin-top: 16px; }
.refer-step-num {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px;
  background: linear-gradient(180deg, var(--primary-light), var(--bg-white));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(1, 101, 154, 0.06);
}
.refer-step-text { flex: 1; }
.refer-step-desc { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.refer-step-muted { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.refer-step-muted strong { color: var(--primary-dark); }

/* Influencer Card */
.refer-influencer-card {
  margin: 0 16px 16px; /* FIX: Remove large bottom margin */
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
}
.refer-influencer-text { font-size: 14px; color: var(--text-primary); }
.refer-influencer-text span { font-size: 13px; color: var(--text-secondary); }
.refer-influencer-contact {
  background: var(--primary-color); color: white; text-decoration: none;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; white-space: nowrap;
}

/* Terms Modal List */
.terms-list {
  text-align: left;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.terms-list li {
  margin-bottom: 10px;
}

/* Profile Page */
#profilePage .section {
  padding: 0;
}

.profile-user-card h2 {
  font-size: 18px; /* UPDATED */
  font-weight: 600; /* UPDATED */
}

.profile-user-card p {
  font-size: 14px;
  font-weight: 300;
  opacity: 0.9;
}

.profile-actions {
  margin: 0 20px 30px;
  background: transparent; /* Remove background from container */
  border-radius: 16px;
  box-shadow: none; /* Remove shadow from container */
  overflow: hidden;
}

.profile-button {
  background: var(--bg-white);
  color: var(--text-primary);
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  transition: background-color 0.2s;
  width: 100%;
}

.profile-actions {
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.profile-button:last-child {
  border-bottom: none;
}

.profile-button:active {
  background-color: var(--bg-light);
  transform: none;
}

.profile-button::after {
  content: '›';
  margin-left: auto;
  font-size: 20px;
  color: #c7c7cc;
}

.profile-button i {
  color: var(--primary-color);
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.profile-footer {
  text-align: center;
  padding: 0 20px 30px;
}

.profile-footer .app-version {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 300;
}

/* --- FIX: Style the Login/Signup CTA button --- */
.profile-button.login-cta {
  background: var(--primary-color);
  color: white;
  font-weight: 700;
  justify-content: center; /* Center the text */
  box-shadow: 0 4px 12px rgba(1, 101, 154, 0.3);
  border-radius: 0; /* Override default button radius if any */
}

/* Remove the arrow from the CTA button */
.profile-button.login-cta::after {
  content: none;
}

/* Adjust active state for the CTA */
.profile-button.login-cta:active {
  background-color: var(--primary-dark); /* Darken on click */
}

/* --- NEW: Refined Profile Page Styles --- */
.profile-button.refer {
  /* NEW: Make the Refer button a prominent CTA */
  background: var(--accent-color);
  color: var(--bg-white);
  font-weight: 600;
}

.profile-button.refer i {
  color: var(--bg-white); /* Match icon color to text */
}

.profile-button.install-app {
  background: var(--success-color);
  color: var(--bg-white);
  font-weight: 600;
}

.profile-button.install-app i {
  color: var(--bg-white);
}

.social-bar {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  margin: 0 20px 20px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.social-bar a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
  font-size: 22px; /* Smaller icons */
}

.social-bar a:hover, .social-bar a:active {
  color: var(--primary-color);
}

/* Bottom Navigation - FIXED: Properly constrained to mobile container */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  /* FIX: Use calc() to add safe-area padding to the bottom */
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  width: 100%;
  max-width: var(--app-max-width);
  /* FIX: Use min-height to prevent content from being cut off */
  min-height: var(--bottom-nav-height);
}

/* NEW: Hide bottom nav when any modal/popup is open */
body.popup-open .bottom-bar {
  display: none;
}

@media (min-width: 481px) {
  .bottom-bar {
    border-radius: 0 0 20px 20px;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  /* FIX: Increase contrast for inactive labels for better accessibility */
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  padding: 8px 12px;
  border-radius: 12px;
  min-height: 44px;
  min-width: var(--bottom-nav-btn-width);
  justify-content: center;
}

.nav-item.active {
  color: var(--primary-color);
  background: var(--primary-light);
}

.nav-item i {
  font-size: var(--bottom-nav-icon-size);
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--error-color);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-white);
}

/* Toast */
.toast {
  position: fixed;
  bottom: var(--toast-bottom);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success-color);
  color: white;
  padding: 12px 20px;
  border-radius: 10px; /* UPDATED */
  font-weight: 500; /* Medium */
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--app-max-width);
  width: calc(100% - 40px);
}

/* --- NEW: Simple Tooltip --- */
.simple-tooltip {
  position: fixed;
  background: var(--text-primary);
  color: var(--bg-white);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2001; /* Above toast */
  opacity: 0;
  pointer-events: none; /* It can't be interacted with */
  transition: opacity 0.2s ease;
  max-width: 200px;
  text-align: center;
  transform: translate(-50%, -100%); /* Position above and centered */
}

/* --- NEW: Confirmation Modal --- */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1500; /* Above other modals but below toast */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-modal-overlay.active {
  display: flex;
}

.confirm-modal-card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
  animation: slideUpAndFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.confirm-modal-card p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.confirm-modal-actions { display: flex; gap: 12px; }

.confirm-modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.simple-tooltip.show {
  opacity: 1;
}

.confirm-modal-btn:active {
  transform: scale(0.98);
}

/* "Keep Shopping" button - secondary style */
.confirm-modal-btn.cancel {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* "Yes, Clear Cart" button - destructive action style */
.confirm-modal-btn.confirm {
  background: var(--error-color);
  color: var(--bg-white);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- NEW: Custom Install Prompt --- */
.install-prompt {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 10px); /* Above bottom nav */
  left: 50%;
  transform: translateX(-50%) translateY(150%); /* Initially hidden below */
  width: calc(100% - 24px);
  max-width: calc(var(--app-max-width) - 24px);
  background: var(--primary-dark);
  color: var(--bg-white);
  border-radius: 14px;
  padding: 12px 16px;
  display: none; /* Hidden by default, JS will show it */
  align-items: center;
  justify-content: space-between;
  z-index: 999; /* Above content, below modals */
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-prompt.show {
  display: flex;
  transform: translateX(-50%) translateY(0);
}

.install-prompt-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-prompt-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.install-prompt-text {
  display: flex;
  flex-direction: column;
}

.install-prompt-text strong { font-weight: 600; font-size: 15px; }
.install-prompt-text span { font-size: 13px; opacity: 0.9; }

.install-prompt-actions { display: flex; align-items: center; gap: 8px; }

.install-btn {
  background: var(--accent-color);
  color: var(--bg-white);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.install-dismiss-btn {
  background: none;
  border: none;
  color: var(--bg-white);
  font-size: 24px;
  opacity: 0.7;
  cursor: pointer;
  padding: 0 4px;
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

/* Catalog page sticky elements */
#catalog .categories {
  position: sticky;
  /* Ticker (30px) + Header (107px) */
  top: 137px;
  background: var(--bg-white);
  z-index: 100;
  /* Use margin to break out of section padding and padding to restore it */
  margin: 0 -20px;
  padding: 5px 20px 15px;
}
/* Adjust for desktop */

@keyframes slideUpAndFadeIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- NEW: Skeleton Loader with Shimmer --- */
.skeleton-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.skeleton-image {
  aspect-ratio: 1 / 1; /* NEW: Match product image aspect ratio for smooth loading */
}

.skeleton-info {
  padding: 12px;
}

.skeleton-text {
  height: 1em;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }

.skeleton-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.skeleton-price {
  height: 1.2em;
  width: 40%;
  border-radius: 4px;
}

.skeleton-button {
  height: 32px;
  width: 80px;
  border-radius: 16px;
}

/* Shimmer effect */
.shimmer {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
}
/* --- End of Skeleton Loader --- */

/* Sticky "Add New Address" Button */
#addNewAddressBtnFixed {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom)); /* Adjust for bottom nav and safe area */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px); /* 20px padding on each side */
  max-width: calc(var(--app-max-width) - 40px);
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 16px;
  padding: 16px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(1, 101, 154, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 99; /* Below modals, above other content */
}
#addNewAddressBtnFixed:active {
  transform: translateX(-50%) translateY(1px);
  box-shadow: 0 2px 6px rgba(1, 101, 154, 0.3);
}

/* NEW: Ensure address page has a consistent background */
#addressPage {
  background-color: var(--bg-light);
}

/* Empty state for address list */
#addressListContainer .empty-state-address {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 50vh; /* Ensure it takes up some space */
}
#addressListContainer .empty-state-address i {
  font-size: 64px;
  margin-bottom: 24px;
  color: var(--border-color);
}
#addressListContainer .empty-state-address h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
#addressListContainer .empty-state-address p {
  margin-bottom: 32px;
}

/* NEW: Address Page Styles */
.address-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.address-form .form-group {
  display: flex;
  flex-direction: column;
}
.address-form label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.address-form .input {
  /* Reusing login modal input styles and ensuring consistency */
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  font-size: 15px;
  outline: none;
}
.address-form .input:focus {
  border-color: var(--accent-color);
}
.address-form .input[readonly] {
  background-color: var(--bg-light);
  color: var(--text-secondary);
  cursor: not-allowed;
}
.address-form .cta {
  margin-top: 8px; /* Add some space above the button */
  background: var(--success-color);
  color: white;
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  width: 100%;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(56, 142, 60, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.address-form .cta:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  box-shadow: none;
}
.address-form .cta:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(56, 142, 60, 0.3);
}

/* NEW: Address List Styles */
#addressListContainer { padding-bottom: 80px; /* Space for the sticky "Add New Address" button */ }
#addressListContainer .address-item {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 14px; /* Slightly larger radius for a softer look */
  padding: 14px; /* Reduced padding to make card more compact */
  margin-bottom: 16px;
  position: relative;
  transition: border-color 0.2s;
  display: flex; /* Use flexbox for main content and options menu */
  align-items: flex-start; /* Align items to the top */
  gap: 12px; /* Space between icon and text content */
}
#addressListContainer .address-item.default {
  border-color: var(--primary-color);
  border-width: 2px;
  padding: 13px; /* Adjust for border */
}

.address-main-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-grow: 1; /* Allow main content to take available space */
}

.address-pin-icon {
  font-size: 20px;
  color: var(--primary-color);
  flex-shrink: 0; /* Prevent icon from shrinking */
  margin-top: 2px; /* Align with text better */
}

.address-text-content {
  flex-grow: 1;
}

.address-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.address-name {
  font-weight: 600;
  font-size: 16px;
}
#addressListContainer .default-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
/* REFINED: Address body and mobile number */
.address-full-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}
.address-mobile-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500; /* Medium weight for mobile */
  color: var(--text-primary);
}

/* 3-dot menu styles */
.address-options-menu {
  position: relative;
  flex-shrink: 0;
  margin-top: -8px; /* Pull up slightly to align with top of card */
  margin-right: -8px; /* Pull in slightly to align with right of card */
}

.address-options-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.address-options-btn:active {
  background-color: var(--bg-light);
}

.address-dropdown-content {
  display: none;
  position: absolute;
  top: 100%; /* Position below the button */
  right: 0;
  background-color: var(--bg-white);
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 8px;
  z-index: 10;
  overflow: hidden; /* For rounded corners on buttons */
}

.address-dropdown-content.active {
  display: block;
}

.address-dropdown-content .address-action-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s;
}

.address-dropdown-content .address-action-btn:hover {
  background-color: var(--bg-light);
}

.address-dropdown-content .address-action-btn.delete-address-btn {
  color: var(--error-color);
}

/* NEW: Styles for the empty state container on the Favorites page */
#favoritesEmptyState {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh; /* Ensure it takes up significant vertical space */
}

/* --- NEW: Orders Page Styles --- */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


#ordersPage main {
  padding-top: 16px; /* Add padding since header is gone */
  background-color: var(--bg-light);
  min-height: calc(100vh - 150px); /* Adjust based on header height */
}

/* On desktop, allow the main content to be wider */
@media (min-width: 768px) {
  #ordersPage main {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
}

.order-controls {
  padding-top: 8px;
}

.order-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.order-filter-tabs::-webkit-scrollbar { display: none; }

.order-filter-tab {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.order-filter-tab.active {
  background: var(--primary-color);
  color: var(--bg-white);
  border-color: var(--primary-color);
  font-weight: 600;
}

.order-search-container {
  position: relative;
  display: none; /* Hidden for now, can be enabled later */
}

/* --- FINAL: Compact & Refined Order Card Styles --- */
.order-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.order-card:active { transform: scale(0.98); }

.order-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.order-id-block { display: flex; flex-direction: column; gap: 4px; }
.order-id { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.order-meta { font-size: 12px; color: var(--text-secondary); }
.order-price { font-weight: 700; color: var(--primary-dark); font-size: 18px; }

.order-item-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--bg-light);
  border-bottom: 1px solid var(--bg-light);
}
.order-thumb {
  width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 8px; overflow: hidden; background: var(--bg-light);
  display: grid; place-items: center;
}
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-item-meta { flex: 1; min-width: 0; }
.order-item-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-item-sub { font-size: 13px; color: var(--text-secondary); }

.order-card-bottom {
  display: flex;
  justify-content: center; /* Center the status badge */
  align-items: center; margin-top: 10px;
}

.order-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 16px;
  font-size: 12px; font-weight: 600;
  text-transform: capitalize;
}
.order-status i { font-size: 11px; }

/* Status: In Progress (Pending, Accepted) */
.order-status.inprogress { background-color: #FFF3E0; color: #EF6C00; }

/* Status: In Transit */
.order-status.transit { background-color: #E3F2FD; color: #1E88E5; }

/* Status: Completed */
.order-status.completed { background-color: #E8F5E9; color: #388E3C; }

/* Status: Cancelled */
.order-status.cancelled { background-color: #FFEBEE; color: #D32F2F; }

/* --- NEW: Logged-out Empty State Styles --- */
.logged-out-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px;
  flex-grow: 1;
  min-height: 60vh;
  gap: 18px;
}

.logged-out-prompt .illustration {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(1,101,154,0.06), rgba(1,101,154,0.02));
  box-shadow: 0 6px 18px rgba(2,6,23,0.08);
  padding: 18px;
}

.logged-out-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.1px;
}

.logged-out-lead {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
  max-width: 360px;
}

.logged-out-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

/* NEW: Secondary style for cart-cta buttons */
.cart-cta.secondary {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* NEW: Subtle text link style for secondary CTAs */
.text-link-cta {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px;
}

/* --- REVAMPED: Order Details Drawer --- */
.drawer-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 1100;
  display: flex; justify-content: center; align-items: flex-end;
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }

.drawer {
  background: var(--bg-light); width: 100%; max-height: 90vh;
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer-overlay.active .drawer { transform: translateY(0); }

.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
  background: var(--bg-white); border-radius: 16px 16px 0 0; flex-shrink: 0;
}
.drawer-title { font-size: 18px; font-weight: 700; }
.drawer-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 8px; }

.drawer-content { flex-grow: 1; overflow-y: auto; padding: 16px; }
.drawer-section { background: var(--bg-white); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.drawer-section:last-child { margin-bottom: 0; }

.drawer-order-meta { display: flex; justify-content: space-between; text-align: center; gap: 8px; }
.drawer-order-meta > div { flex: 1; }
.meta-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.meta-value { font-size: 14px; font-weight: 600; }

.drawer-section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* --- Status Timeline --- */
.order-status-timeline { display: flex; align-items: flex-start; }
.status-step { display: flex; flex-direction: column; align-items: center; text-align: center; width: 60px; position: relative; }
.status-icon {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-light); color: var(--text-secondary); border: 2px solid var(--border-color); transition: all 0.3s ease;
}
.status-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-top: 8px; }
.status-line { flex-grow: 1; height: 2px; background: var(--border-color); margin-top: 18px; }
.status-step.active .status-icon { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); }
.status-step.active .status-label { color: var(--primary-color); }
.status-step.current .status-icon { box-shadow: 0 0 0 4px var(--primary-light); }
.status-step.cancelled .status-icon { background: #FFEBEE; border-color: var(--error-color); color: var(--error-color); }
.status-step.cancelled .status-label { color: var(--error-color); }
.status-line.active { background: var(--primary-color); }

/* --- Items List --- */
#drawerItemsList { display: flex; flex-direction: column; gap: 12px; }
.drawer-item { display: flex; align-items: center; gap: 12px; }
.drawer-item-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.drawer-item-info { flex-grow: 1; }
.drawer-item-name { font-weight: 500; }
.drawer-item-qty { font-size: 13px; color: var(--text-secondary); }
.drawer-item-price { font-weight: 600; }

/* --- Bill Summary --- */
.drawer-bill-details { display: flex; flex-direction: column; gap: 8px; }
.drawer-bill-row { display: flex; justify-content: space-between; font-size: 14px; }
.drawer-bill-row span:first-child { color: var(--text-secondary); }
.drawer-bill-row span:last-child { font-weight: 500; }
.drawer-bill-row.discount span:last-child { color: var(--success-color); }
.drawer-bill-row.grand-total {
  font-size: 18px; font-weight: 700; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}
.drawer-bill-row.grand-total span:first-child { color: var(--text-primary); }

/* --- Address Section --- */
.drawer-address-content strong {
  display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px;
}
.drawer-address-content p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}

.drawer-footer {
  display: flex; gap: 12px; padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color); background: var(--bg-white);
}
.drawer-action-btn {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--border-color);
  font-size: 15px; font-weight: 600; cursor: pointer; background: var(--bg-white); color: var(--text-primary);
}
.drawer-action-btn.primary { background: var(--primary-color); color: white; }

@media (min-width: 768px) {
  .drawer-overlay { align-items: center; }
  .drawer { max-width: 420px; max-height: 80vh; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
}
/* --- End of Revamped Drawer Styles --- */

/* NEW: Section Divider Style */
.section-divider {
  height: 12px;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 375px) {
  .app, .product-popup, .bottom-bar {
    max-width: 375px;
  }
  
  .title {
    font-size: 24px;
  }
  
  .section {
    padding: 16px;
  }
  
  .carousel {
    margin: 0 16px 16px;
    height: 140px;
  }
  
  .trust-strip {
    margin: 0 16px 16px;
  }
  
  #catalog .categories {
    top: 114px;
  }
  
  .popup-title {
    font-size: 20px;
  }
}

@media (max-width: 320px) {
  .app, .product-popup, .bottom-bar {
    max-width: 320px;
  }
  
  .title {
    font-size: 22px;
  }
  
  .section {
    padding: 12px;
  }
  
  .carousel {
    margin: 0 12px 12px;
    height: 120px;
  }
  
  .trust-strip {
    margin: 0 12px 12px;
    padding: 12px 8px;
  }
  
  .trust-item {
    padding: 8px 4px;
  }
  
  .trust-title {
    font-size: 12px;
  }
  
  .trust-sub {
    font-size: 11px;
  }
  
  .name {
    font-size: 14px;
  }
  
  .final-price {
    font-size: 16px;
  }
  
  .add-btn, .cart-controls {
    width: 32px;
    height: 32px;
  }
  
  .cart-controls .qty-btn {
    width: 24px;
    height: 24px;
  }
  
  #catalog .categories {
    top: 112px;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- NEW: Variant Selection Drawer --- */
.variant-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.variant-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.variant-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-white);
  z-index: 1201;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.variant-drawer-overlay,
.variant-drawer {
  display: none; /* Hide elements by default */
}

.variant-drawer.active {
  display: flex; /* FIX: Show the drawer when active */
  transform: translateY(0);
}
.variant-drawer-overlay.active {
  display: block; /* FIX: Show the overlay when active */
}

.variant-drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  position: relative;
}
.variant-drawer-title {
  font-size: 18px;
  font-weight: 600;
}
.variant-drawer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
}

.variant-drawer-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.variant-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}
.variant-option .variant-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.variant-option .variant-cta {
  flex-shrink: 0;
}
.variant-option .variant-info-name {
  font-weight: 600;
  font-size: 15px;
}
.variant-option .variant-info-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.variant-option .final-price {
  font-weight: 700;
  font-size: 16px;
}
.variant-option .old-price {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: line-through;
}
.variant-option .discount-badge {
  background: #e8f5e9;
  color: var(--success-color);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
}

.variant-option .add-btn {
  position: static; /* Override absolute positioning from product card */
  background: var(--success-color);
  box-shadow: 0 2px 6px rgba(56, 142, 60, 0.3);
}
.variant-option .cart-controls {
  position: static; /* Override absolute positioning */
  background: var(--success-color);
  box-shadow: 0 2px 6px rgba(56, 142, 60, 0.3);
}

/* --- DESKTOP FIX: Constrain variant drawer to the app container --- */
@media (min-width: 481px) {
  .variant-drawer-overlay {
    position: absolute; /* Change from fixed to absolute */
    border-radius: 20px; /* Match app container's border radius */
    /* FIX: Make the overlay cover the entire app container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .variant-drawer {
    position: absolute; /* Change from fixed to absolute */
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: var(--app-max-width);
  }
  .variant-drawer.active {
    transform: translateX(-50%) translateY(0);
  }
}

/* --- NEW: Contact Us Page Styles --- */
.contact-page-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-hero {
  text-align: center;
  padding: 20px 0;
}

.contact-hero i {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.contact-hero h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
}

.contact-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-card:active { transform: scale(0.98); }
.contact-card i { font-size: 24px; }
.contact-card.email i { color: var(--primary-color); }
.contact-card.whatsapp i { color: #25D366; }
.contact-card-text strong { display: block; font-size: 16px; font-weight: 600; }
.contact-card-text span { font-size: 13px; color: var(--text-secondary); }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes tick {
  50% { transform: scale(1.05); }
}
.variant-option .variant-cta {
  flex-shrink: 0;
}
.variant-option .add-btn {
  position: static; /* Override absolute positioning from product card */
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes tick {
  50% { transform: scale(1.05); }
}