/* ============================================================
   BLOUSE PLANET — Enhanced Responsive System
   Mobile-first, fluid, accessible
   ============================================================ */

/* ── Fluid type scale ─────────────────────────────────────── */
:root {
  --fs-xs:   clamp(0.75rem,  1.8vw, 0.8125rem);
  --fs-sm:   clamp(0.8125rem,2vw,   0.875rem);
  --fs-base: clamp(0.875rem, 2.2vw, 1rem);
  --fs-md:   clamp(1rem,     2.5vw, 1.125rem);
  --fs-lg:   clamp(1.125rem, 3vw,   1.375rem);
  --fs-xl:   clamp(1.375rem, 4vw,   1.875rem);
  --fs-2xl:  clamp(1.75rem,  5vw,   2.5rem);
  --fs-3xl:  clamp(2.25rem,  6vw,   3.5rem);
  --fs-4xl:  clamp(2.75rem,  7vw,   4.5rem);

  --sp-1:  clamp(4px,  1vw, 8px);
  --sp-2:  clamp(8px,  2vw, 12px);
  --sp-3:  clamp(12px, 2vw, 16px);
  --sp-4:  clamp(16px, 3vw, 20px);
  --sp-6:  clamp(20px, 4vw, 28px);
  --sp-8:  clamp(24px, 5vw, 40px);
  --sp-12: clamp(32px, 6vw, 60px);
  --sp-16: clamp(40px, 7vw, 80px);
  --sp-24: clamp(52px, 8vw, 100px);
}

/* ── Container fluid ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* ── Grid helpers ─────────────────────────────────────────── */
.grid-auto-fill { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px,100%), 1fr)); gap: var(--sp-6); }
.grid-auto-fit  { display: grid; grid-template-columns: repeat(auto-fit,  minmax(min(260px,100%), 1fr)); gap: var(--sp-6); }

/* ── Products grid responsive ─────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px,100%),1fr));
  gap: clamp(12px, 2.5vw, 24px);
}

/* ── Categories grid responsive ──────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px,100%),1fr));
  gap: clamp(10px, 2vw, 16px);
}

/* ── Section spacing fluid ────────────────────────────────── */
.products-section   { padding: var(--sp-16) 0; }
.categories-strip   { padding: var(--sp-12) 0; }
.brand-story        { padding: var(--sp-16) 0; }
.features-strip     { padding: var(--sp-12) 0; }
.collections-showcase { padding: var(--sp-16) 0; }
.testimonials       { padding: var(--sp-16) 0; }
.social-feed        { padding: var(--sp-16) 0; }
.newsletter         { padding: var(--sp-16) 0; }
.site-footer        { padding-top: var(--sp-16); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  height: clamp(480px, 80svh, 860px);
  min-height: 420px;
}
.hero-content { padding: 0 clamp(20px, 5vw, 64px); max-width: clamp(300px, 55vw, 600px); }
.hero-title   { font-size: var(--fs-4xl); }
.hero-sub     { font-size: var(--fs-base); }

/* ── Features strip ───────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px,100%),1fr));
  gap: 0;
}
.feature-item {
  border-right: 1px solid rgba(107,26,42,.08);
  padding: 0 clamp(12px,2.5vw,32px);
}
.feature-item:last-child { border-right: none; }

/* ── Brand story ──────────────────────────────────────────── */
.brand-story-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

/* ── Collections ──────────────────────────────────────────── */
.collections-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(10px, 1.5vw, 16px);
}

/* ── Testimonials ─────────────────────────────────────────── */
.testimonials-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px,100%),1fr));
  gap: clamp(16px, 3vw, 24px);
  margin-top: var(--sp-8);
}

/* ── Social feed ──────────────────────────────────────────── */
.social-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(4px, 1vw, 8px);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}

/* ── Shop layout ──────────────────────────────────────────── */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(24px, 3vw, 40px);
  padding: clamp(32px, 5vw, 60px) 0;
  align-items: start;
}

/* ── Product detail ───────────────────────────────────────── */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.product-gallery {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: clamp(8px, 1.5vw, 12px);
}

/* ── Newsletter form ──────────────────────────────────────── */
.newsletter-form {
  max-width: clamp(300px, 55vw, 480px);
  margin: var(--sp-8) auto 0;
}

/* ── Promo banner ─────────────────────────────────────────── */
.promo-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(220px, 30vw, 320px);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.promo-text { padding: clamp(28px,5vw,60px) clamp(24px,4vw,56px); }

/* ── Brand stats ──────────────────────────────────────────── */
.brand-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: clamp(16px, 3vw, 24px);
}
.brand-stat-num { font-size: clamp(28px,4vw,42px); }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── 1400px — very wide ───────────────────────────────────── */
@media (max-width: 1400px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* ── 1100px ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .shop-layout { grid-template-columns: 220px 1fr; }
  .features-grid { grid-template-columns: repeat(2,1fr); }
  .feature-item { border-right: none; border-bottom: 1px solid rgba(107,26,42,.08); padding: var(--sp-4) 0; }
  .feature-item:nth-child(odd) { padding-right: var(--sp-6); border-right: 1px solid rgba(107,26,42,.08); }
  .feature-item:last-child { border-bottom: none; }
}

/* ── 960px — tablet landscape ────────────────────────────── */
@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .main-nav { display: none; }
  .hamburger { display: flex; }

  .brand-story-inner { grid-template-columns: 1fr; gap: var(--sp-8); }
  .brand-story-visual { display: none; }

  .collections-grid { grid-template-columns: 1fr; }
  .collection-card.tall { min-height: 320px; grid-row: span 1; }
  .collection-card.short { min-height: 220px; }

  .product-detail-grid { grid-template-columns: 1fr; }
  .product-gallery { grid-template-columns: 1fr; }
  .gallery-thumbs { flex-direction: row; overflow-x: auto; }
  .gallery-thumb  { width: 60px; height: 76px; flex-shrink: 0; }

  .promo-banner { grid-template-columns: 1fr; }
  .promo-visual { display: none; }

  .newsletter-form { flex-direction: column; border-radius: var(--radius); }
  .newsletter-form input  { border-right: 1px solid rgba(250,246,240,.2); border-radius: var(--radius) var(--radius) 0 0; }
  .newsletter-form button { border-radius: 0 0 var(--radius) var(--radius); }
  .newsletter-perks { flex-direction: column; align-items: center; gap: 10px; }
}

/* ── 768px — tablet portrait ─────────────────────────────── */
@media (max-width: 768px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filter-sidebar {
    position: fixed !important;
    inset: 0;
    z-index: 250;
    transform: translateX(-100%);
    transition: transform .35s ease;
    overflow-y: auto;
    border-radius: 0;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
  }
  .filter-sidebar.open { transform: translateX(0); }
  .filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44,36,33,.5);
    z-index: 240;
    backdrop-filter: blur(2px);
  }
  .filter-overlay.open { display: block; }
  .filter-btn-mobile {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid var(--maroon);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--maroon);
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    letter-spacing: .05em;
  }
  .filter-sidebar-close {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(107,26,42,.1);
  }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .brand-stats { grid-template-columns: repeat(3,1fr); }

  .hero-arrows { display: none; }
  .hero-ctas { flex-direction: column; align-items: flex-start; }
  .hero-ctas .btn { width: 100%; max-width: 280px; justify-content: center; }

  .add-to-cart-wrap { flex-wrap: wrap; }
  .add-to-cart-wrap .btn:first-child { flex: 1 1 100%; }

  .cart-sidebar { width: 100%; }
}

/* ── 600px — large mobile ─────────────────────────────────── */
@media (max-width: 600px) {
  .products-grid { grid-template-columns: repeat(2,1fr); gap: clamp(10px,3vw,14px); }
  .categories-grid { grid-template-columns: repeat(2,1fr); gap: clamp(8px,2vw,12px); }
  .social-grid { grid-template-columns: repeat(3,1fr); }
  .brand-stats { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-item { border-right: none; border-bottom: 1px solid rgba(107,26,42,.08); padding: var(--sp-4) 0; }
  .feature-item:last-child { border-bottom: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
  .product-name { font-size: 15px; }
  .price-current { font-size: 17px; }
  .section-head { margin-bottom: 28px; }
  .hero-content { max-width: 100%; }
}

/* ── 400px — small mobile ─────────────────────────────────── */
@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-info  { padding: 12px 12px 14px; }
  .product-sizes { display: none; }
  .logo-tagline  { display: none; }
  .hero          { min-height: 380px; }
  .social-grid   { grid-template-columns: repeat(2,1fr); }
  .brand-stats   { grid-template-columns: 1fr; }
}

/* ── Utilities ────────────────────────────────────────────── */
.hide-mobile  { }
.show-mobile  { display: none !important; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}
.filter-btn-mobile { display: none; }
.filter-sidebar-close { display: none; }
.filter-overlay { display: none; }

/* ── Shop layout — product grid capped at 3 cols with sidebar ── */
@media (min-width: 769px) {
  .shop-layout .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Social footer icons — natural color icons ────────────── */
.social-link img {
  opacity: 0.85;
  transition: opacity .2s;
}
.social-link:hover img { opacity: 1; }

/* ── WhatsApp floating button — icon sizing ────────────────── */
.whatsapp-float img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

/* ── Footer contact icon — WhatsApp img alignment ──────────── */
.footer-contact-item img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.7;
}

/* ── Cart layout — stack on tablet/mobile ──────────────────── */
@media (max-width: 768px) {
  [style*="grid-template-columns:1fr 360px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 2-col inline grids — stack on mobile ──────────────────── */
@media (max-width: 768px) {
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .site-header, .announcement-bar, .cart-sidebar,
  .mobile-menu, #backTop, .wishlist-btn { display: none !important; }
  body { background: white; color: black; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .announcement-bar .marquee-inner { animation: none; }
}

/* ── High contrast ────────────────────────────────────────── */
@media (forced-colors: active) {
  .btn-primary  { border: 2px solid ButtonText; }
  .badge        { border: 1px solid ButtonText; }
}

/* ── Touch improvements ───────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .quick-add    { transform: none; opacity: 1; background: rgba(107,26,42,.85); font-size: 11px; padding: 9px; }
  .wishlist-btn { opacity: 1; transform: scale(1); }
  .product-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .btn:hover    { transform: none; }
  .size-chip, .size-btn { min-height: 40px; min-width: 40px; }
  .qty-btn      { min-width: 36px; min-height: 36px; }
  .header-icon-btn { width: 44px; height: 44px; }
}

/* ── Focus visible ────────────────────────────────────────── */
:focus-visible {
  outline: 2.5px solid var(--maroon);
  outline-offset: 3px;
  border-radius: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }

/* ── Scroll snap product row ──────────────────────────────── */
@media (max-width: 600px) {
  .products-row-snap {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 12px;
    scrollbar-width: none;
  }
  .products-row-snap::-webkit-scrollbar { display: none; }
  .products-row-snap .product-card {
    flex: 0 0 clamp(160px, 44vw, 200px);
    scroll-snap-align: start;
  }
}

/* ── Page hero variants ───────────────────────────────────── */
.page-hero {
  background: var(--maroon);
  padding: clamp(32px, 6vw, 72px) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0, transparent 30px, rgba(196,150,58,.05) 30px, rgba(196,150,58,.05) 60px);
}
.page-hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 500;
  color: var(--offwhite);
  position: relative;
}
.page-hero-sub {
  font-size: var(--fs-base);
  color: rgba(250,246,240,.65);
  margin-top: 10px;
  position: relative;
}

/* ── Form elements ────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 7px;
  letter-spacing: .03em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: clamp(10px,2vw,13px) clamp(12px,2.5vw,16px);
  border: 1.5px solid rgba(107,26,42,.18);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(107,26,42,.1);
}
.form-input.error { border-color: #C0392B; }
.form-error { font-size: 12px; color: #C0392B; margin-top: 5px; display: none; }
.form-error.show { display: block; }
.form-textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ── Cards generic ────────────────────────────────────────── */
.info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}
.info-card-icon { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.info-card-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 500; color: var(--charcoal); margin-bottom: 8px; }
.info-card-body  { font-size: var(--fs-sm); color: var(--mid); line-height: 1.7; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(107,26,42,.1);
  margin-bottom: 32px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 22px;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--mid);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: color .2s, border-color .2s;
  margin-bottom: -2px;
}
.tab-btn.active { color: var(--maroon); border-bottom-color: var(--maroon); }
.tab-btn:hover { color: var(--maroon); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Table responsive ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.styled { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.styled th { background: var(--maroon); color: var(--offwhite); padding: 12px 16px; text-align: left; white-space: nowrap; }
table.styled td { padding: 11px 16px; border-bottom: 1px solid rgba(107,26,42,.08); }
table.styled tr:nth-child(even) { background: var(--offwhite-2); }
table.styled tr:hover { background: var(--maroon-pale); }

/* ── Steps / timeline ─────────────────────────────────────── */
.steps { display: flex; gap: 0; position: relative; }
.steps::before { content: ''; position: absolute; top: 24px; left: 24px; right: 24px; height: 2px; background: rgba(107,26,42,.15); z-index: 0; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; z-index: 1; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--offwhite-2); border: 2px solid rgba(107,26,42,.2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; color: var(--mid); margin-bottom: 12px; transition: var(--transition); }
.step.active .step-num, .step.done .step-num { background: var(--maroon); border-color: var(--maroon); color: var(--offwhite); }
.step-label { font-size: 12px; font-weight: 500; color: var(--mid); letter-spacing: .06em; }
.step.active .step-label { color: var(--maroon); font-weight: 600; }
@media (max-width: 480px) {
  .steps::before { display: none; }
  .steps { flex-direction: column; gap: 12px; }
  .step { flex-direction: row; text-align: left; gap: 12px; }
  .step-num { flex-shrink: 0; width: 36px; height: 36px; font-size: 14px; }
}

/* ── Alert / notice ───────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: var(--radius); font-size: var(--fs-sm); line-height: 1.6; margin-bottom: 20px; }
.alert-info    { background: #EAF4FB; border-left: 4px solid #2E86C1; color: #1A5276; }
.alert-success { background: #EAFAF1; border-left: 4px solid #1A7340; color: #1A5631; }
.alert-warn    { background: #FEF9E7; border-left: 4px solid #C09A00; color: #7D6608; }
.alert-error   { background: #FDEDEC; border-left: 4px solid #C0392B; color: #922B21; }

/* ── Sticky mobile bottom bar ─────────────────────────────── */
.sticky-buy-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  padding: 12px 16px;
  border-top: 1px solid rgba(107,26,42,.12);
  z-index: 80;
  gap: 10px;
  box-shadow: 0 -4px 16px rgba(107,26,42,.12);
}
.sticky-buy-bar .btn { flex: 1; justify-content: center; }
@media (max-width: 768px) {
  .sticky-buy-bar { display: flex; }
  .product-detail { padding-bottom: 100px; }
}

/* ── Skeleton loading ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--offwhite-2) 25%, var(--maroon-pale) 50%, var(--offwhite-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-img   { aspect-ratio: 3/4; }

/* ── WhatsApp floating button ─────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px; height: 52px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  z-index: 79;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  transition: transform .25s, box-shadow .25s;
  text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37,211,102,.5); }
@media (max-width: 768px) { .whatsapp-float { bottom: 88px; } }
