/* =============================================================
   BlueCart Homepage Rebuild (UNIFIED)
   Goal: Complete modern homepage experience using canonical tokens.
   
   - New structures: hero-section, featured-product-card, category-card
     brand-card, market-item-card, newsletter modernization.
   ============================================================= */

/* Override card styling for consistent rounded design */
/* Root layout helpers */
.homepage-body { background: var(--bg-primary); color: var(--text-primary); }
/* Removed body padding-top; sticky navbar already consumes layout space. */
.homepage-body .container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
/* Skip link for accessibility */
.skip-link { position:absolute; left:-999px; top:0; background:var(--bluecart-primary); color:var(--text-light); padding:.75rem 1rem; border-radius:8px; font-weight:600; z-index:10000; transition: left .3s ease; }
.skip-link:focus { left:12px; outline:3px solid var(--bluecart-focus); }
/* Loading placeholders */
.placeholder-item, .placeholder-brand { background: var(--slate-100); border-radius:12px; animation: pulsePlaceholder 1.4s ease-in-out infinite; }
@keyframes pulsePlaceholder { 0%,100% { opacity:.55; } 50% { opacity:1; } }

/* HERO (matches markup .hero-section) */
.hero-section { position: relative; padding: 4.5rem 0 5.5rem; background: linear-gradient(135deg,var(--bluecart-primary) 0%, var(--bluecart-cyan) 100%); overflow: hidden; }
.hero-section::before { content:''; position:absolute; inset:0; background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.18), transparent 60%); opacity:.55; pointer-events:none; }
.hero-container { display:grid; grid-template-columns: minmax(0, 640px) minmax(320px, 480px); gap:3rem; align-items:center; max-width:1280px; margin:0 auto; padding:0 1.5rem; }
@media (max-width: 980px){ .hero-container { grid-template-columns: 1fr; text-align:center; gap:2.75rem; } }
.hero-content { position:relative; z-index:2; }
.hero-title { font-size: clamp(2.2rem,4.2vw,3.25rem); line-height:1.08; background: linear-gradient(90deg,#ffffff 0%, rgba(255,255,255,0.85) 60%, rgba(255,255,255,0.75) 100%); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; margin:0 0 1rem; font-weight:800; letter-spacing:-0.5px; }
.hero-subtitle { color: rgba(255,255,255,0.92); font-size: clamp(1rem,1.25vw,1.15rem); line-height:1.55; max-width:56ch; margin:0 0 1.75rem; }
.hero-actions { display:flex; gap:1rem; flex-wrap:wrap; }
.hero-features { display:flex; flex-wrap:wrap; gap:.85rem 1.25rem; margin-top:1.25rem; }
.feature-item { font-weight:600; font-size:.95rem; color:rgba(255,255,255,0.95); display:flex; gap:.5rem; align-items:center; }
@media (max-width:640px){ .hero-actions { flex-direction:column; } .hero-features { justify-content:center; } }

/* Hero visuals */
.hero-visual { position:relative; z-index:1; }
.hero-image-container { position:relative; width:100%; max-width:460px; height:360px; margin:0 auto; }
@media (max-width:980px){ .hero-image-container { height:340px; } }
@media (max-width:640px){ .hero-image-container { height:300px; } }
.hero-main-visual { 
  position: relative; 
  width: 100%; 
  height: 100%; 
  border-radius: 24px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  overflow: hidden;
}

/* Background blur layer */
.hero-main-visual::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(4px);
  border-radius: 24px;
  box-shadow: 0 12px 48px -12px rgba(0,0,0,0.25);
  z-index: 1;
}

/* Shopping Cart Hero Animation */
.shopping-cart-hero { 
  position: relative;
  display: flex; 
  align-items: center; 
  justify-content: center;
  animation: cartFloat 6s ease-in-out infinite;
  z-index: 2; /* Above the blur background */
}

.cart-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-icon {
  color: var(--bluecart-primary);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  animation: cartPulse 4s ease-in-out infinite;
}

/* NOTE: Renamed decorative orbiting items from generic .cart-item to .hero-orbit-item* to avoid
   collision with functional cart system styles (which also use .cart-item). */
.hero-orbit-item {
  position: absolute;
  font-size: 1.8rem;
  animation: itemOrbit 8s linear infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.hero-orbit-item-1 { 
  animation-delay: 0s; 
  transform: rotate(0deg) translateX(80px) rotate(0deg);
}
.hero-orbit-item-2 { 
  animation-delay: 2s; 
  transform: rotate(90deg) translateX(80px) rotate(-90deg);
}
.hero-orbit-item-3 { 
  animation-delay: 4s; 
  transform: rotate(180deg) translateX(80px) rotate(-180deg);
}
.hero-orbit-item-4 { 
  animation-delay: 6s; 
  transform: rotate(270deg) translateX(80px) rotate(-270deg);
}

@keyframes cartFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

@keyframes cartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes itemOrbit {
  0% { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .shopping-cart-hero, .cart-icon, .hero-orbit-item {
    animation: none;
  }
}

/* Responsive cart adjustments */
@media (max-width: 768px) {
  .cart-icon {
    width: 80px;
    height: 80px;
  }
  
  .hero-orbit-item {
    font-size: 1.4rem;
  }
  
  .hero-orbit-item-1, .hero-orbit-item-2, .hero-orbit-item-3, .hero-orbit-item-4 {
    transform: rotate(0deg) translateX(60px) rotate(0deg);
  }
  
  @keyframes itemOrbit {
    0% { transform: rotate(0deg) translateX(60px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
  }
}

@media (max-width: 480px) {
  .cart-icon {
    width: 60px;
    height: 60px;
  }
  
  .hero-orbit-item {
    font-size: 1.2rem;
  }
  
  .hero-orbit-item-1, .hero-orbit-item-2, .hero-orbit-item-3, .hero-orbit-item-4 {
    transform: rotate(0deg) translateX(45px) rotate(0deg);
  }
  
  @keyframes itemOrbit {
    0% { transform: rotate(0deg) translateX(45px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(45px) rotate(-360deg); }
  }
}

.scroll-indicator { position:absolute; left:50%; transform:translateX(-50%); bottom:10px; color:rgba(255,255,255,0.9); text-align:center; font-size:.85rem; letter-spacing:.5px; }
.scroll-arrow { font-size:1.1rem; animation: scrollPulse 1.6s infinite ease-in-out; }
@media (prefers-reduced-motion:reduce){ .scroll-arrow { animation:none; } }

/* Categories modern */
.categories-section { background: var(--bg-primary); padding: 3.5rem 0 3.25rem; }
.categories-grid { display:grid; gap:1.25rem; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); }
.category-card { position:relative; background: var(--bg-secondary); border:1px solid var(--slate-200); padding:1.1rem .95rem 1.15rem; text-align:center; display:flex; flex-direction:column; align-items:center; gap:.55rem; box-shadow:var(--shadow-sm); transition:box-shadow .3s ease, transform .3s ease, border-color .3s; cursor:pointer; }
.category-card:hover { transform:translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--bluecart-primary); }
.category-icon { width:60px; height:60px; display:flex; align-items:center; justify-content:center; font-size:1.9rem; border-radius:16px; background:linear-gradient(135deg,var(--bluecart-primary),var(--bluecart-cyan)); color:var(--text-light); box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.category-title { font-size:1rem; font-weight:700; color:var(--text-primary); margin:0; }
.category-desc { font-size:.75rem; line-height:1.3; color:var(--text-secondary); flex-grow:1; }
.category-count { font-size:.7rem; font-weight:600; letter-spacing:.5px; text-transform:uppercase; color:var(--bluecart-primary-dark); opacity:.85; }
.category-arrow { position:absolute; top:10px; right:10px; font-size:.9rem; color:var(--text-muted); opacity:0; transform:translateY(-4px); transition:.3s; }
.category-card:hover .category-arrow { opacity:1; transform:translateY(0); }

/* Section headers */
.section-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start; 
  gap: var(--spacing-6); 
  margin: 0 0 var(--spacing-8) 0; 
}

.section-header-content {
  flex: 1;
}

@media (max-width: 980px) { 
  .section-header { 
    flex-direction: column; 
    text-align: center; 
    align-items: center; 
    gap: var(--spacing-4);
  } 
}

.section-title,
.homepage-body .section-title,
h2.section-title { 
  font-size: clamp(2.2rem, 3.2vw, 2.8rem); 
  font-weight: 800; 
  margin: 0; 
  color: var(--bluecart-primary);
}

.section-subtitle { 
  font-size: 0.95rem; 
  color: var(--text-secondary); 
  margin: var(--spacing-2) 0 0 0; 
}

.section-action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-6);
  background: var(--bluecart-gradient);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(46, 134, 193, 0.2);
  white-space: nowrap;
}

.section-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(46, 134, 193, 0.3);
  text-decoration: none;
  color: white;
}

.section-action-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.section-action-btn:hover svg {
  transform: translateX(2px);
}

/* Featured products modern */
.featured-section { background: var(--bg-primary); padding:3.25rem 0 3.5rem; }
.featured-grid { display:grid; gap:1.25rem; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); }
.featured-product-card.homepage-variant { background: var(--card-bg); border:1px solid var(--slate-200); border-radius: var(--card-radius); display:flex; flex-direction:column; position:relative; overflow:hidden; min-height:100%; box-shadow: var(--shadow-xs); transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base); }
.featured-product-card.homepage-variant:hover { transform:translateY(-6px); box-shadow: var(--shadow-xl); border-color: var(--bluecart-primary); }
.featured-grid .featured-product-card.homepage-variant .product-image { position:relative; background:linear-gradient(135deg,var(--bg-secondary),var(--bg-primary)); aspect-ratio: 1 / 1; max-height: 200px; display:flex; align-items:center; justify-content:center; overflow:visible; border-radius: calc(var(--card-radius) - 4px); }
.featured-product-card .product-img { width:100%; height:auto; object-fit:contain; object-position: center; display:block; }
.featured-product-card .product-emoji { font-size:3rem; }
.featured-product-card .product-badge { position:absolute; top:10px; left:10px; }
.featured-product-card .product-info { display:flex; flex-direction:column; gap:.4rem; padding:0.9rem 1rem 1.1rem; }
.featured-product-card .product-category { font-size:.7rem; text-transform:uppercase; letter-spacing:.7px; font-weight:600; color:var(--bluecart-primary-dark); }
.featured-product-card .product-name { font-size:1rem; font-weight:700; line-height:1.3; min-height:2.6em; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.featured-product-card .product-brand { font-size:.7rem; font-weight:600; text-transform:uppercase; letter-spacing:.75px; color:var(--text-muted); }
.featured-product-card .product-rating { display:flex; align-items:center; gap:.4rem; font-size:.75rem; }
.featured-product-card .stars { font-size:.8rem; color:var(--bluecart-warning); letter-spacing:1px; }
.featured-product-card .rating-text { font-weight:600; color:var(--text-secondary); }
.featured-product-card .product-price { font-size:1.15rem; font-weight:800; color:var(--bluecart-primary); margin-top:.25rem; }
.featured-product-card .product-sku { font-size:.65rem; color:var(--text-muted); letter-spacing:.5px; }
.featured-product-card .add-to-cart-btn { margin-top:.5rem; background:var(--gradient-primary); color:var(--text-light); border:none; border-radius: var(--radius-lg); padding:.65rem .9rem; font-weight:700; font-size:.9rem; display:inline-flex; gap:.5rem; align-items:center; justify-content:center; cursor:pointer; box-shadow:var(--shadow-sm); transition:box-shadow .25s ease, transform .25s ease; }
.featured-product-card .add-to-cart-btn:hover { box-shadow:var(--shadow-lg); transform:translateY(-3px); }
.featured-product-card .add-to-cart-btn:active { transform:translateY(-1px) scale(.98); }
.featured-product-card .add-to-cart-btn:disabled { background:linear-gradient(135deg,var(--slate-200),var(--slate-100)); color:var(--text-muted); cursor:not-allowed; box-shadow:none; }


/* Benefits grid */
.benefits-section { padding:2.5rem 0; background:var(--bg-secondary); }
.benefits-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap:1rem; }
.benefit-card { background:var(--bg-primary); padding:1.25rem; border-radius:12px; text-align:center; box-shadow:var(--shadow-sm); }
.benefit-icon { font-size:1.6rem; margin-bottom:0.6rem; }

/* Brands & Market placeholders */
/* Brand & Market section base */
.brands-section, .market-section { padding:3rem 0 3.25rem; }
.brands-section { background: var(--bg-secondary); }
.market-section { background: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary)); }
.brands-grid, .market-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 1.15rem; 
  align-items: stretch; 
}
.placeholder-brand, .placeholder-item { 
  background: var(--bg-secondary); 
  height: 84px; 
  border-radius: 14px; 
}

/* Brand cards */
/* Brand cards */
.brand-card.homepage-variant { 
  position: relative; 
  background: var(--bg-primary); 
  border: 1px solid var(--slate-200); 
  padding: 1rem .85rem 1.1rem; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: .55rem; 
  text-align: center; 
  box-shadow: var(--shadow-sm); 
  transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease; 
  cursor: pointer; 
}
.brand-card.homepage-variant:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--bluecart-primary); }
.brand-card.homepage-variant:active { transform: translateY(-2px); }
.brand-logo { 
  width: 68px; 
  height: 68px; 
  border-radius: 16px; 
  background: linear-gradient(135deg, var(--bluecart-primary), var(--bluecart-cyan)); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 2rem; 
  color: var(--text-light); 
  box-shadow: 0 6px 16px -4px rgba(0,0,0,.25); 
}
.brand-logo img.brand-img { 
  width: 100%; 
  height: auto; 
  object-fit: contain; 
  object-position: center; 
  border-radius: inherit; 
  display: block; 
  background: white; 
  padding: 2px; 
}
.brand-name { 
  font-weight: 700; 
  font-size: .95rem; 
  color: var(--text-primary); 
  line-height: 1.2; 
}
.brand-category { 
  font-size: .65rem; 
  text-transform: uppercase; 
  letter-spacing: .6px; 
  font-weight: 600; 
  color: var(--text-muted); 
}
.brand-products-count { font-size:.65rem; font-weight:600; letter-spacing:.5px; background: var(--bluecart-primary-alpha); color: var(--bluecart-primary-dark); padding:.25rem .55rem; border-radius:999px; }

/* Market item cards */
.market-item-card.homepage-variant { background: var(--bg-primary); border:1px solid var(--slate-200); border-radius:20px; display:flex; flex-direction:column; overflow:hidden; position:relative; min-height:100%; box-shadow:var(--shadow-sm); transition: box-shadow .35s ease, transform .35s ease, border-color .35s ease; cursor: pointer; }
.market-item-card.homepage-variant:hover { transform:translateY(-6px); box-shadow:var(--shadow-xl); border-color: var(--bluecart-primary); }
.market-item-card.homepage-variant:focus-visible { outline: 3px solid var(--bluecart-focus); outline-offset: 3px; }
.market-item-image { position:relative; aspect-ratio: 1 / 1; max-height: 150px; display:flex; align-items:center; justify-content:center; font-size:2.3rem; background:linear-gradient(135deg,var(--bg-secondary),var(--bg-primary)); overflow: visible; }
.market-item-image img.market-item-img { width:100%; height:auto; object-fit:contain; object-position: center; display:block; }
.market-item-tags { position:absolute; top:8px; left:8px; display:flex; flex-wrap:wrap; gap:4px; }
.market-tag { font-size:.55rem; font-weight:700; letter-spacing:.6px; text-transform:uppercase; padding:.25rem .45rem; border-radius:999px; background:rgba(0,0,0,0.6); color:var(--text-light); }
.market-tag.fresh { background:linear-gradient(135deg,var(--bluecart-primary),var(--bluecart-cyan)); }
.market-tag.organic { background:linear-gradient(135deg,var(--bluecart-secondary),var(--bluecart-primary)); }
.market-item-content { display:flex; flex-direction:column; gap:.4rem; padding:.9rem 1rem 1.1rem; }
.market-item-category { font-size:.65rem; font-weight:600; text-transform:uppercase; letter-spacing:.6px; color:var(--bluecart-primary-dark); opacity:.9; }
.market-item-name { font-size:1rem; font-weight:700; line-height:1.3; min-height:2.6em; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.market-item-description { font-size:.75rem; line-height:1.4; color:var(--text-secondary); min-height:2.1em; }
.market-item-price { font-size:1.05rem; font-weight:800; color:var(--bluecart-primary); margin-top:.15rem; }
/* Make entire market item card interactive via JS (onclick + keydown). No per-item button. */
.market-hover-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bluecart-gradient);
  color: var(--text-light);
  padding: 0.4rem 0.7rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(46, 134, 193, 0.25);
}
.market-item-card.homepage-variant:hover .market-hover-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Align market card visuals with product cards (top gradient bar on hover) */
.market-item-card.homepage-variant::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--bluecart-gradient); transform: scaleX(0); transition: transform 0.3s ease; z-index: 2; }
.market-item-card.homepage-variant:hover::before { transform: scaleX(1); }

/* Testimonials removed from homepage */

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scrollPulse {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.7; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .hero-title {
    font-size: var(--font-size-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
  
  /* testimonials removed */
}

@media (max-width: 480px) {
  .hero-section {
    min-height: 80vh;
    padding-top: var(--spacing-8);
  }
  
  .hero-content {
    padding: var(--spacing-6);
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-base);
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: var(--font-size-2xl);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.btn:focus-visible,
.section-action-btn:focus-visible,
.newsletter-btn:focus-visible {
  outline: 2px solid var(--bluecart-primary);
  outline-offset: 2px;
}

/* Reduced Motion Support */
.visually-hidden { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0 0 0 0) !important; white-space:nowrap !important; border:0 !important; }
@media (prefers-reduced-motion: reduce) {
  .hero-title,
  .hero-subtitle,
  .testimonial-card {
    animation: none;
  }
  
  .testimonial-card:hover,
  .section-action-btn:hover,
  .btn:hover {
    transform: none;
  }
}

/* Respect reduced motion for CTA and scroll pulse */
@media (prefers-reduced-motion: reduce) {
  .scroll-arrow { animation: none !important; }
  .scroll-indicator { opacity: 0.95; }
  .btn, .section-action-btn, .newsletter-btn { transition: none !important; }
}

/* Ensure sections are visible by default on mobile if JS fails */
@media (max-width: 768px) {
  .categories-section, 
  .featured-section, 
  .benefits-section, 
  .brands-section, 
  .market-section {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  /* Re-enable animations only when JS has set up observer */
  .categories-section.is-visible, 
  .featured-section.is-visible, 
  .benefits-section.is-visible, 
  .brands-section.is-visible, 
  .market-section.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ==========================================================================
   NEWSLETTER SECTION STYLES
   ========================================================================== */

.newsletter-section {
  background: linear-gradient(135deg, #2E86C1 0%, #00F2FE 100%);
  padding: 4rem 2rem;
  margin: 4rem 0;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="1" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>') repeat;
  pointer-events: none;
}

.newsletter-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.newsletter-text {
  margin-bottom: 2.5rem;
}

.newsletter-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.newsletter-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  margin-bottom: 0;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto 1.5rem;
  flex-wrap: wrap;
}

.newsletter-input {
  flex: 1;
  min-width: 280px;
  padding: 1rem 1.5rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.newsletter-input::placeholder {
  color: rgba(255,255,255,0.7);
}

.newsletter-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.newsletter-btn {
  padding: 1rem 2rem;
  background: white;
  color: #2E86C1;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.newsletter-btn:hover:not(:disabled) {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.newsletter-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.newsletter-privacy {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
  .newsletter-section {
    padding: 3rem 1.5rem;
    margin: 3rem 1rem;
    border-radius: 16px;
  }
  
  .newsletter-title {
    font-size: 2rem;
  }
  
  .newsletter-subtitle {
    font-size: 1rem;
  }
  
  .newsletter-form {
    flex-direction: column;
    gap: 1rem;
  }
  
  .newsletter-input {
    min-width: auto;
  }
  
  .newsletter-btn {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .newsletter-section {
    padding: 2.5rem 1rem;
    margin: 2rem 0.5rem;
  }
  
  .newsletter-title {
    font-size: 1.75rem;
  }
  
  .newsletter-text {
    margin-bottom: 2rem;
  }
}

/* =============================================================
   GRID RESPONSIVENESS & CENTERING (counts-aware)
   Ensure small item counts are centered and distributed nicely.
   These apply to homepage grids after render sets data-count.
   ============================================================= */

.featured-grid,
.categories-grid,
.brands-grid,
.market-grid { 
  margin-left: auto;
  margin-right: auto;
  justify-items: stretch;
}

/* 1 item: center a reasonably sized column */
.featured-grid[data-count="1"],
.categories-grid[data-count="1"],
.brands-grid[data-count="1"],
.market-grid[data-count="1"] {
  grid-template-columns: minmax(240px, 520px);
  justify-content: center;
}

/* 2 items: two balanced columns, cap width */
.featured-grid[data-count="2"],
.categories-grid[data-count="2"],
.brands-grid[data-count="2"],
.market-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  max-width: 980px;
}

/* 3 items: three columns with sensible max width */
.featured-grid[data-count="3"],
.categories-grid[data-count="3"],
.brands-grid[data-count="3"],
.market-grid[data-count="3"] {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  max-width: 1260px;
}

/* Fallback for 4+ stays auto-fit behavior; width caps not required */




/* =============================================================
   HOMEPAGE VISUAL OVERRIDES (scoped and minimal)
   Keep homepage visuals stable without !important or cross-page impact
   ============================================================= */

/* Ensure homepage-variant cards keep intended background and radius */
.homepage-body .brand-card.homepage-variant,
.homepage-body .market-item-card.homepage-variant,
.homepage-body .featured-product-card.homepage-variant {
  background: var(--bg-primary);
  border-radius: var(--card-radius, var(--radius-2xl));
}

/* Lock square images and caps in homepage context */
.homepage-body .featured-product-card.homepage-variant .product-image,
.homepage-body .market-item-card.homepage-variant .market-item-image {
  aspect-ratio: 1 / 1;
}
.homepage-body .featured-product-card.homepage-variant .product-image { max-height: 200px; }
.homepage-body .market-item-card.homepage-variant .market-item-image { max-height: 150px; }
.homepage-body .brand-card.homepage-variant .brand-logo { width:68px; height:68px; }




