/* =========================================================
   VENTO Midnight — Mobile-first QA stylesheet
   Breakpoints: 320 / 360 / 375 / 390 / 414 / 430 / 768 / 980
   Primary: phone. Desktop must not fight these rules.
   ========================================================= */

*,
*::before,
*::after{box-sizing:border-box}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
html,body{
  overflow-x:clip;
  max-width:100%;
}
body{min-width:0}
img,video,iframe,svg,canvas,table{
  max-width:100%;
  height:auto;
}

/* Prevent sticky stacking / CLS */
.site-header,
.mobile-bar,
.search-drawer,
.announcement{max-width:100%}

.mobile-bar{display:none}

/* ---------- Shared mobile utilities ---------- */
@media (max-width:980px){
  :root{
    --vento-gutter:16px;
    --vento-touch:44px;
  }

  .container{
    width:min(100% - (var(--vento-gutter) * 2), var(--max)) !important;
  }

  /* ===== HEADER ===== */
  .site-header{
    padding:0 !important;
    margin:0 !important;
    width:100%;
    z-index:200;
  }
  .site-header .container.site-header-inner,
  .site-header-inner{
    display:grid !important;
    grid-template-columns:var(--vento-touch) minmax(0,1fr) auto !important;
    align-items:center;
    gap:8px !important;
    min-height:var(--mh, 56px);
    padding:4px 12px !important;
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    border-radius:0 !important;
    border-top:0 !important;
  }
  .header-style-bar .site-header-inner,
  .header-style-midnight .site-header-inner,
  .header-style-dark .site-header-inner{
    border-radius:0 !important;
    width:100% !important;
  }
  .site-brand{
    min-width:0 !important;
    max-width:100%;
    justify-self:start;
    overflow:visible;
  }
  .site-brand a{display:inline-flex;max-width:100%;align-items:center;line-height:0}
  /* Logo size comes from Customizer CSS vars — do NOT hard-lock height */
  .site-brand img,
  .site-brand .vento-logo{
    max-width:min(var(--logo-w-m, 140px), 55vw) !important;
    max-height:var(--logo-h-m, 40px) !important;
    width:auto;
    height:auto;
    object-fit:contain !important;
  }
  .main-nav{display:none !important}
  .mobile-toggle{
    display:inline-grid !important;
    place-items:center;
    width:var(--vento-touch) !important;
    height:var(--vento-touch) !important;
    min-width:var(--vento-touch);
    min-height:var(--vento-touch);
    flex-shrink:0;
    border-radius:50%;
  }
  .header-actions{
    display:flex !important;
    align-items:center;
    justify-content:flex-end;
    gap:4px;
    flex-wrap:nowrap;
  }
  .header-design{display:none !important}
  .icon-btn{
    width:var(--vento-touch) !important;
    height:var(--vento-touch) !important;
    min-width:var(--vento-touch);
    min-height:var(--vento-touch);
    flex-shrink:0;
  }
  .vento-cart-count{
    top:2px;inset-inline-start:2px;left:auto;
  }

  /* Mobile menu — usable submenu */
  .mobile-menu{
    display:none;
    width:min(100% - (var(--vento-gutter) * 2), var(--max));
    margin-inline:auto;
    margin-top:8px;
    padding:8px;
    background:var(--soft-white,#fafbfa);
    border:1px solid var(--line);
    border-radius:16px;
    box-shadow:0 16px 40px rgba(8,20,38,.12);
  }
  .mobile-menu.open{display:block}
  .mobile-menu ul{list-style:none;margin:0;padding:0}
  .mobile-menu > ul > li > a,
  .mobile-menu .menu-item > a{
    display:flex;
    align-items:center;
    min-height:var(--vento-touch);
    padding:10px 14px;
    font-size:14px;
    font-weight:800;
    border-radius:12px;
  }
  .mobile-menu .menu-item > a:hover,
  .mobile-menu .menu-item > a:focus-visible{
    background:var(--cream-2,#eef1ef);
  }
  .mobile-menu .sub-menu{
    display:none;
    list-style:none;
    margin:0;
    padding:0 0 0 8px;
  }
  .mobile-menu .submenu-open > .sub-menu{display:block}
  .mobile-menu .sub-menu a{
    min-height:44px;
    padding:10px 14px;
    font-size:13px;
    color:var(--muted);
  }

  .announcement{
    font-size:12px;
    padding:10px 12px;
    line-height:1.45;
    word-break:break-word;
  }
  .announcement a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:32px;
  }

  /* ===== SECTIONS ===== */
  .section{padding:36px 0 !important}
  .section-title{
    font-size:clamp(22px, 6vw, 32px) !important;
    line-height:1.3 !important;
    overflow-wrap:anywhere;
  }
  .section-copy{font-size:13px;line-height:1.7;max-width:100%}
  .section-head{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:12px !important;
    margin-bottom:18px !important;
  }
  .section-head .btn{
    align-self:stretch;
    width:100%;
    justify-content:center;
    min-height:var(--vento-touch);
  }

  /* ===== BENEFITS ===== */
  .benefit-row{gap:10px}
  .benefit-mobile-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .benefit-card{
    padding:14px 10px;
    border-radius:14px;
    min-height:var(--vento-touch);
  }
  .benefit-card strong{font-size:13px}
  .benefit-card p{font-size:11px;line-height:1.5}
  .benefit-ico{width:40px;height:40px}

  /* ===== CATEGORIES — 2 col on phone landscape / large phone ===== */
  .category-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }
  .cats-scroll,
  .category-grid.cats-scroll{
    display:flex !important;
    grid-template-columns:none !important;
    overflow-x:auto;
    gap:12px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px;
  }
  .cats-scroll .category-card{
    min-width:72%;
    flex:0 0 auto;
    scroll-snap-align:start;
  }
  .category-card{
    min-height:180px !important;
    border-radius:16px !important;
    overflow:hidden;
  }
  .category-content{padding:14px !important}
  .category-content h3{font-size:16px !important;line-height:1.3}
  .category-content span{font-size:11px !important}

  /* ===== PRODUCTS — 2 col default ===== */
  .product-grid,
  .woocommerce ul.products{
    grid-template-columns:repeat(var(--shop-now-m, 2), minmax(0,1fr)) !important;
    gap:10px !important;
  }
  .product-card{
    min-width:0;
    border-radius:14px;
    overflow:hidden;
  }
  .product-image{
    aspect-ratio:3/4;
    background:var(--cream-2,#eef1ef);
  }
  .product-image img{
    width:100%;
    height:100%;
    object-fit:contain;
    object-position:center;
  }
  .product-body{padding:10px !important}
  .product-body h3{
    font-size:13px !important;
    line-height:1.4 !important;
    display:-webkit-box;
    -webkit-line-clamp:2;
    line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .product-price,
  .product-price .amount,
  .product-price bdi{
    font-size:12px !important;
    line-height:1.45 !important;
    white-space:normal !important;
  }
  .product-card-actions{padding:0 10px 12px}
  .product-card-atc{
    width:100%;
    min-height:var(--vento-touch) !important;
    font-size:11px !important;
    padding:0 8px !important;
  }
  .product-badge{font-size:10px;padding:4px 8px}

  /* ===== DESIGNER CTA / BUSINESS ===== */
  .designer-split,
  .business-grid,
  .footer-grid,
  .feature-row,
  .designer-app{
    grid-template-columns:1fr !important;
    gap:16px !important;
  }
  .designer-visual{
    min-height:220px !important;
    border-radius:16px !important;
  }
  .designer-visual img{
    width:auto;
    max-width:78%;
    max-height:240px;
    margin-inline:auto;
  }
  .reference-panel{
    padding:14px !important;
    border-radius:16px !important;
    overflow:hidden !important;
  }
  .reference-panel:before{display:none !important}
  .steps{margin:16px 0;width:100%}
  .step{
    grid-template-columns:36px minmax(0,1fr);
    gap:10px;
    min-width:0;
  }
  .step b,.step span{
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .business-card{padding:18px !important;border-radius:16px !important}
  .business-card h2,
  .business-card h3{font-size:clamp(20px,5.5vw,26px) !important;line-height:1.3}
  /* Legacy .final-cta only — new bands use .vband in home-bands.css */
  .final-cta:not(.vband){
    padding:22px 16px !important;
    border-radius:16px !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:14px !important;
  }
  .final-cta:not(.vband) h2{font-size:clamp(22px,6vw,30px) !important}
  .final-cta:not(.vband) .btn,
  .business-card .btn,
  .shop-more .btn{
    width:100%;
    justify-content:center;
    min-height:var(--vento-touch);
  }

  /* ===== BUTTONS / FORMS ===== */
  .btn{
    min-height:var(--vento-touch);
    padding:0 16px;
    font-size:13px;
    max-width:100%;
  }
  input[type="text"],
  input[type="email"],
  input[type="search"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  textarea,
  select{
    min-height:var(--vento-touch);
    font-size:16px !important; /* prevents iOS zoom */
    max-width:100%;
  }
  .newsletter-form{flex-direction:column;align-items:stretch}
  .newsletter-form input[type=email],
  .newsletter-form .btn{width:100%;min-width:0}
  .vento-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:10px !important}
  .vento-load-more{width:100%;min-height:48px}

  /* ===== SEARCH ===== */
  .search-drawer{
    padding:max(64px, calc(env(safe-area-inset-top,0px) + 56px)) 12px 12px;
    align-items:flex-start;
  }
  .search-box{
    width:100%;
    max-width:100%;
    padding:14px;
    border-radius:16px;
  }
  .search-box form{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .search-box input[type="search"]{
    width:100%;
    min-height:var(--vento-touch);
    border-radius:12px;
    padding:0 14px;
    border:1px solid var(--line);
  }
  .search-box .btn,
  .search-close{
    width:100%;
    min-height:var(--vento-touch);
  }
  .search-dismiss{
    width:var(--vento-touch) !important;
    height:var(--vento-touch) !important;
  }

  /* ===== WOO / CART / CHECKOUT ===== */
  .shop-layout.has-sidebar:not(.shop-drawer){grid-template-columns:1fr !important}
  .shop-layout:not(.shop-drawer) .shop-sidebar-card{position:static !important;margin-bottom:14px}
  .woocommerce div.product{
    grid-template-columns:1fr !important;
    gap:16px !important;
  }
  .woocommerce div.product .woocommerce-product-gallery{
    position:static !important;
  }
  .woocommerce div.product .product_title{
    font-size:clamp(22px,6vw,32px) !important;
  }
  .woocommerce div.product form.cart{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
  }
  .woocommerce div.product form.cart .quantity,
  .woocommerce div.product form.cart .button{
    width:100% !important;
  }
  .woocommerce div.product form.cart .button{
    min-height:var(--vento-touch) !important;
  }
  .woocommerce .quantity .qty{
    min-height:var(--vento-touch);
    min-width:64px;
    font-size:16px !important;
  }
  .woocommerce-cart .woocommerce,
  .woocommerce-checkout .woocommerce{
    padding:0 !important;
    border-radius:0 !important;
    max-width:100%;
    overflow:visible !important;
  }
  body.woocommerce-cart .container,
  body.woocommerce-checkout .container{
    max-width:100%;
  }
  .woocommerce-cart-form .product-remove a,
  .woocommerce a.remove{
    display:inline-grid;
    place-items:center;
    width:var(--vento-touch);
    height:var(--vento-touch);
    font-size:18px !important;
  }
  .woocommerce-checkout #payment,
  .woocommerce-checkout .woocommerce-billing-fields,
  .woocommerce-checkout .woocommerce-additional-fields,
  .vento-bank-panel,
  .vento-bank-card{
    max-width:100% !important;
    width:100%;
    box-sizing:border-box;
    overflow:visible !important;
  }
  .woocommerce #place_order,
  .woocommerce-cart .checkout-button,
  .woocommerce .button.checkout{
    width:100% !important;
    min-height:48px !important;
  }
  .woocommerce ul.products li.product .button,
  .woocommerce ul.products li.product .added_to_cart{
    min-height:40px !important;
    padding:8px 6px !important;
    font-size:11px !important;
    display:flex !important;
    align-items:center;
    justify-content:center;
  }

  /* ===== FOOTER ===== */
  .site-footer:not(.footer-v2){
    padding:36px 0 calc(24px + var(--mobile-bar-h,64px) + env(safe-area-inset-bottom,0px)) !important;
  }
  body.has-mobile-bar .site-footer.footer-v2{
    padding-bottom:calc(20px + var(--mobile-bar-h,64px) + env(safe-area-inset-bottom,0px)) !important;
  }
  .footer-col a{
    display:flex;
    align-items:center;
    min-height:40px;
    font-size:13px;
  }
  .footer-bottom{
    font-size:11px !important;
    display:block !important;
  }
  .footer-bottom span{display:block;margin-top:4px}
  .vento-social a{min-height:var(--vento-touch)}

  /* ===== BOTTOM NAV + SAFE AREA ===== */
  .mobile-bar{
    position:fixed !important;
    display:flex !important;
    inset-inline:0;
    left:0;
    right:0;
    bottom:0;
    z-index:250;
    height:auto !important;
    min-height:var(--mobile-bar-h, 64px);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing:border-box;
    background:rgba(255,255,255,.97);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--line);
    border-radius:0 !important;
    box-shadow:0 -8px 28px rgba(8,20,38,.08);
    align-items:stretch;
    justify-content:space-around;
    gap:0;
    overflow:visible !important;
    width:100% !important;
    max-width:100vw !important;
  }
  .mobile-bar a,
  .mobile-bar button,
  .mobile-bar .mobile-bar-item{
    flex:1 1 0;
    min-width:0;
    min-height:48px;
    max-width:none;
    display:flex !important;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    padding:4px 2px !important;
    border:0;
    background:transparent;
    color:#778093;
    font-size:10px;
    font-weight:800;
    font-family:inherit;
    cursor:pointer;
    text-decoration:none;
    -webkit-tap-highlight-color:transparent;
    overflow:visible;
  }
  .mobile-bar .vento-icon{width:22px;height:22px;pointer-events:none;flex-shrink:0}
  .mobile-bar small{
    font-size:10px;
    line-height:1.15;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    display:block;
  }
  .mobile-bar .active{color:var(--cyan)}
  .mobile-bar-ico{position:relative;display:grid;place-items:center;width:24px;height:24px;flex-shrink:0}
  .mobile-cart-badge{
    position:absolute;
    top:-6px;
    inset-inline-start:-8px;
    min-width:16px;
    height:16px;
    padding:0 4px;
    border-radius:999px;
    background:var(--cyan);
    color:#fff;
    font-size:10px;
    line-height:16px;
    text-align:center;
  }
  body.has-mobile-bar{
    padding-bottom:calc(var(--mobile-bar-h,64px) + env(safe-area-inset-bottom,0px) + 12px) !important;
  }

  /* Sticky ATC on designer shouldn't collide with bottom bar */
  .studio-cart-form{
    bottom:calc(var(--mobile-bar-h,64px) + env(safe-area-inset-bottom,0px) + 8px) !important;
  }

  /* Page hero */
  .page-hero{padding:32px 0 16px !important}
  .page-hero h1{font-size:clamp(24px,7vw,36px) !important;overflow-wrap:anywhere}

  .marquee{overflow:hidden !important}
  .marquee span{font-size:20px !important;padding:0 12px !important}
}

/* ---------- Large phone / small tablet (≤768) ---------- */
@media (max-width:768px){
  :root{--vento-gutter:14px}
  .product-grid,
  .woocommerce ul.products{
    grid-template-columns:repeat(var(--shop-now-m, 2), minmax(0,1fr)) !important;
  }

  .category-grid:not(.cats-scroll){
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .cine-nav{display:none !important}
  .cine-dot{
    min-width:12px !important;
    min-height:12px !important;
    width:12px !important;
    height:12px !important;
    padding:0 !important;
  }
  .cine-dot.is-active{width:28px !important;border-radius:20px !important}
  .cine-controls{
    bottom:10px !important;
    padding:8px;
  }
}

/* ---------- Standard phones ≤430 ---------- */
@media (max-width:430px){
  :root{--vento-gutter:12px}

  .site-header-inner{padding:4px 8px !important}
  .section{padding:28px 0 !important}
  .section-title{font-size:clamp(20px,6.2vw,28px) !important}

  .product-body h3{font-size:12.5px !important}
  .product-price{font-size:12px !important}

  .category-card{min-height:160px !important}
  .category-content h3{font-size:15px !important}

  .benefit-card strong{font-size:12px}
  .benefit-card p{font-size:10.5px}
}

/* ---------- Small phones ≤360 (incl 320) ---------- */
@media (max-width:360px){
  :root{--vento-gutter:10px}

  .site-brand img{max-width:min(100px,40vw) !important;max-height:30px !important}
  .product-grid,
  .woocommerce ul.products{gap:8px !important}
  .product-card-atc{font-size:10px !important}
  .category-grid:not(.cats-scroll){
    grid-template-columns:1fr !important;
  }
  .benefit-mobile-grid{grid-template-columns:1fr 1fr !important}
  .mobile-bar small{font-size:9px}
  .cine-title{font-size:clamp(18px,5.8vw,22px) !important}
  .cine-lead{font-size:12px !important}
}

/* ---------- Hero mobile — keep image strategy, no forced destruction ---------- */
@media (max-width:980px){
  .cine-hero-wrap{
    padding:6px 0 0 !important;
    overflow:hidden !important;
  }
  .cine-hero{
    min-height:var(--hero-min-hm, 420px) !important;
    height:auto !important;
    border-radius:16px !important;
    overflow:hidden !important;
    perspective:none;
  }
  .cine-slides,
  .cine-slide.is-active{
    min-height:inherit;
    height:auto;
  }
  .cine-bg{
    /* Prefer dedicated mobile bg when set; keep desktop bg otherwise */
    background-image:var(--cine-bg-m, var(--cine-bg)) !important;
    background-position:center top !important;
    background-size:cover !important;
    transform:none !important;
    filter:none !important;
  }
  .cine-inner,
  .layout-product-left .cine-inner,
  .layout-product-right .cine-inner{
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:flex-start !important;
    grid-template-columns:1fr !important;
    width:100% !important;
    max-width:100% !important;
    min-height:0 !important;
    padding:16px 14px 52px !important;
    gap:8px !important;
    box-sizing:border-box !important;
  }
  .cine-visual{
    order:1 !important;
    width:100% !important;
    transform:none !important;
    min-height:0 !important;
    display:flex !important;
    justify-content:center !important;
  }
  .cine-float{
    width:min(200px, 55vw) !important;
    max-height:220px !important;
    height:auto !important;
    object-fit:contain !important;
  }
  .cine-copy{
    order:2 !important;
    width:100% !important;
    text-align:center !important;
    transform:none !important;
    justify-self:center !important;
  }
  .cine-title{
    font-size:clamp(20px, 6vw, 28px) !important;
    line-height:1.35 !important;
    overflow-wrap:anywhere !important;
    text-align:center !important;
  }
  .cine-lead{
    font-size:13px !important;
    margin-inline:auto !important;
    max-width:34em;
  }
  .cine-feats{
    justify-content:center !important;
  }
  .cine-feats li{
    font-size:11px !important;
    padding:8px 10px !important;
    min-height:36px;
  }
  .cine-cta{
    min-height:44px !important;
    margin-inline:auto !important;
  }
  .cine-cta--ice img{
    width:min(200px, 70vw) !important;
    height:auto !important;
  }
  .cine-glow,
  .cine-particles{display:none !important}
}

/* ---------- Designer studio mobile ===== */
@media (max-width:980px){
  .vento-studio-page .page-hero{padding-bottom:8px !important}
  .studio-layout{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:14px !important;
  }
  .studio-preview-pane{
    order:-1;
    position:static !important;
  }
  .studio-canvas-wrap{
    width:100%;
    max-width:100%;
    margin-inline:auto;
    border-radius:16px;
    overflow:hidden;
  }
  #vento-designer-canvas{
    width:100% !important;
    height:auto !important;
    max-height:min(52vh, 420px);
    display:block;
  }
  .studio-steps{
    position:sticky;
    top:calc(var(--mh,56px) + 8px);
    z-index:40;
    display:flex;
    gap:6px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding:8px 0;
    background:var(--cream);
  }
  .studio-step{
    flex:0 0 auto;
    min-width:48px;
    min-height:48px;
  }
  .studio-step span{display:none}
  .garment-grid{grid-template-columns:1fr !important}
  .garment-card{
    min-height:56px;
    padding:14px;
  }
  .color-grid{grid-template-columns:repeat(5,minmax(0,1fr)) !important}
  .color-swatch{
    width:100% !important;
    aspect-ratio:1;
    min-height:44px;
    border-radius:12px !important;
  }
  .control-group label{
    display:block;
    margin-bottom:6px;
    font-size:13px;
    font-weight:800;
  }
  .control-group input[type=range]{
    width:100%;
    min-height:44px;
  }
  .scene-grid,
  .anim-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .scene-card,
  .anim-card{
    min-height:48px;
    padding:12px 8px;
  }
  .studio-nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }
  .studio-nav .btn,
  .studio-final-actions .btn,
  .studio-add-cart{
    flex:1 1 140px;
    min-height:48px;
    width:100%;
  }
  .studio-final-actions{display:grid;gap:10px}
}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  .cine-float-wrap,
  .studio-canvas-wrap,
  .reveal,
  .marquee-track{
    animation:none !important;
    transition:none !important;
  }
}
