/* License.Shopping V51: mobile experience layer.
   OWNER RULE: never change V50 desktop design. All visual changes below are
   viewport-scoped. Protect the existing payment, stock, forms and analytics.
   Regression gate: QA/mobile_regression_v51.py (run before every release).
   V51: responsive navigation; offer/product grid; activation forms; edge clipping.
*/

@media (max-width: 820px) {
  /* Reset desktop centered navigation. The inherited transform was pushing
     the expanded menu off-screen even though its left/right coordinates fit. */
  .site-header-v17 { z-index: 1700; }
  .navrow-v17, .navrow-v17 .nav-v17 { position: relative; }
  .navrow-v17 .nav-v17 { min-height: 64px; justify-content: flex-end; }
  .navrow-v17 .navtoggle-v17 { position: relative; z-index: 2; min-height: 44px;
    padding: 10px 18px; display: inline-flex; align-items:center; justify-content:center;
    cursor:pointer; border-radius:12px; }
  .navrow-v17 .mega-nav-v17 { display: none !important; transform: none !important;
    position: absolute; left: 12px; right: 12px; top: calc(100% + 4px);
    width: auto; max-width: none; margin: 0; white-space: normal; }
  .navrow-v17 .nav-v17.open .mega-nav-v17 {
    display: flex !important; transform: none !important;
    position: absolute; inset-inline: 12px; top: calc(100% + 4px);
    width: auto; max-width: none; min-width: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; padding: 12px; margin: 0;
    border: 1px solid #dbe4f1; border-radius: 17px;
    background: #fff; box-shadow: 0 24px 70px rgba(16,24,72,.22);
    z-index: 1800; max-height: calc(100dvh - 160px); overflow-y:auto;
    overscroll-behavior:contain; -webkit-overflow-scrolling: touch;
  }
  .navrow-v17 .nav-v17.open .mega-nav-v17 > a {
    display:flex; width:100%; min-height: 48px; height:auto;
    align-items:center; justify-content:flex-start;
    font-size: 15px; line-height: 1.35; padding: 12px 16px;
    white-space: normal; box-sizing:border-box;
  }
  .navrow-v17 .nav-v17.open .nav-partners-v24,
  .navrow-v17 .nav-v17.open .nav-telegram-v24 { color:#fff!important; }

  /* Full visibility for the homepage's featured offer. V50's <=560px rule
     translated the offer by -50% even after the container became relative. */
  .v6-hero .v6-hero-grid { min-width:0; gap: 22px !important; }
  .v6-hero .v6-hero-copy, .v6-hero .hero-visual { min-width:0; max-width:100%; }
  .v6-hero .hero-visual { min-height:0; width:100%; margin:0; padding: 8px 0 0; }
  .v6-hero .hero-visual .v17-offer-wrap {
    left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
    transform: none !important; position: relative;
    width:100% !important; max-width: 560px; min-width:0; margin:0 auto;
  }
  .v6-hero .hero-visual .v17-price-card { min-width:0; max-width:100%; }
  .v6-hero .hero-glow { width:min(80vw,320px); height:min(80vw,320px); max-width:100%; pointer-events:none; }
  .v6-hero .v6-hero-copy h1 { overflow-wrap:normal; }

  /* Product showcase: one full-width card, with useful tap targets. */
  #featured-products.v6-product-grid,
  .v6-section #featured-products.product-grid {
    display:grid; grid-template-columns: minmax(0,1fr) !important;
    gap:17px !important; align-items:stretch;
  }
  #featured-products > .product-card {
    width:100%; max-width:100%; min-width:0; min-height:0; padding:18px;
  }
  #featured-products .featured-product-specs { font-size: clamp(16px,4.6vw,21px) !important; line-height:1.3; }
  #featured-products .product-card h3 { font-size:clamp(21px,5.2vw,25px)!important; line-height:1.22; }
  #featured-products .card-bottom { gap:12px; }
  #featured-products .card-bottom .btn { min-height:44px; text-align:center; }

  /* Activation: shrink-to-fit grid tracks; prevent inputs/cards widening the
     entire document. Browsers default grid min-width:auto unless reset. */
  .activation-form-layout-v44 { grid-template-columns:minmax(0,1fr)!important;
    gap:20px; width:100%; max-width:100%; }
  .activation-form-layout-v44 > *, .activation-form-panel-v44,
  .activation-form-intro-v44, .activation-form-v44,
  .activation-form-v44 > * { min-width:0; max-width:100%; }
  .activation-form-v44 input:not([type=radio]):not([type=checkbox]),
  .activation-form-v44 textarea, .activation-form-v44 select { width:100%; max-width:100%; min-width:0; box-sizing:border-box; }
  .activation-form-panel-v44 .ls-turnstile-slot { max-width:100%; overflow:visible; }

  /* Long strings should wrap, not force columns off-screen. */
  .contact-gemini-grid > *, .partner-grid-gemini > *, .product-layout > *,
  .ls-product-hero-grid-v35 > *, .ls-product-specs-v35 > *,
  .ls-detail-grid-v35 > *, .footer-grid > *, .footer-grid-v27 > *,
  .program-card, .contact-method-gemini, .contact-options-card,
  .form-card, .activation-panel, .ls-form-fallback-v49,
  .business-grid > *, .business-opportunity-box,
  .gemini-business-grid > *, .gemini-telegram-card > * { min-width:0; }
  .ls-form-fallback-v49 a, .activation-panel p, .legal-content-v32,
  .contact-method-gemini, .ls-product-buy-v35,
  .contact-gemini-grid p { overflow-wrap:anywhere; }
  .gemini-telegram-mark, .telegram-card-mark { pointer-events:none; }
  .gemini-telegram-card, .telegram-card { overflow:hidden; }
  .product-card, .product-card-featured { max-width:100%; }
}

@media (max-width: 700px) {
  .v6-hero { padding: 34px 0 36px!important; }
  .v6-hero .v6-hero-copy h1 { font-size:clamp(33px,9vw,43px)!important; line-height:1.08; }
  .v6-hero .v6-lead { font-size:16px!important; line-height:1.6; }
  .v6-hero .v6-instant { width:100%; box-sizing:border-box; align-items:flex-start; }
  .v6-hero .v6-cta:not(.v6-cta-wide) { max-width:100%; min-height:48px; text-align:center; }
  .v6-hero .v6-price-card { padding:21px!important; border-radius:20px; }
  .v6-hero .v6-price .amount { font-size:clamp(62px,19vw,82px)!important; }
  .v6-hero .v6-offer-badge { flex-wrap:wrap; border-radius:14px; }
  .v6-section { padding:42px 0!important; }
  .v6-section-head h2 { font-size:clamp(28px,7.8vw,35px)!important; line-height:1.12; }
  .v6-section-head p { font-size:15px; line-height:1.6; }
  .v6-product-grid .product-card { border-radius:20px; }
  .ls-product-buy-v35 h1 { font-size:clamp(27px,7.8vw,34px)!important; }
  .ls-product-buy-v35 { padding:clamp(16px,5vw,22px)!important; }
  .ls-product-specs-v35 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ls-product-specs-v35>div { padding:12px 11px; }
  .ls-product-specs-v35 strong { overflow-wrap:anywhere; }
  .ls-product-cta-v35 { min-height:50px!important; }
  .activation-form-intro-v44 h2 { font-size:clamp(27px,8vw,34px); }
  .activation-form-panel-v44 { padding:clamp(14px,4vw,18px); }
  .activation-method-picker-v44 { min-width:0; }
  .activation-radio-option-v44 { min-width:0; }
  .activation-extra-fields-v44 { min-width:0; }
  .activation-hero-actions-v44 > .btn { white-space:normal; line-height:1.4; }
  .form-card .btn[type=submit], .activation-form-v44 button[type=submit] {
    width:100%; min-height:48px; }
  .footer-grid-v27 { gap:18px; }
  .contact-method-gemini { min-height:52px; }
  .ls-product-price-v35 { flex-wrap:wrap; }
}

@media (max-width: 375px) {
  .navrow-v17 .nav-v17.open .mega-nav-v17 { inset-inline: 9px; padding:9px; }
  .v6-hero .v6-price-card { padding:17px!important; }
  #featured-products > .product-card { padding:15px; }
  .ls-product-specs-v35 { grid-template-columns:1fr; }
  .ls-product-assurances-v35 { grid-template-columns:1fr; }
  .activation-form-panel-v44 { padding:13px; }
  .activation-form-layout-v44 { gap:16px; }
  .contact-methods-gemini { grid-template-columns:1fr!important; }
}

/* V51 final width-pass: trust strip and brand filter controls must not keep
   desktop column counts or inline grid tracks on a phone. */
@media (max-width: 700px) {
  .v6-trust-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .v6-trust-grid > div { min-width:0; padding:15px 12px; }
  .v6-trust-grid > div:nth-child(even) { border-right:0; }
  .v6-trust-grid > div:nth-child(-n+2) { border-bottom:1px solid #e4e8f0; }
  .v6-trust-grid strong { font-size:14px; line-height:1.3; }
  .v6-trust-grid small { font-size:11px; line-height:1.4; }
  .launch-brand-products-section .shop-filters {
    display:grid !important; grid-template-columns:minmax(0,1fr)!important;
    gap:10px !important; padding:14px !important;
  }
  .launch-brand-products-section .shop-filters > * {
    display:block; width:100%; max-width:100%; min-width:0; box-sizing:border-box;
  }
}

/* Cloudflare's default widget uses a ~300px embedded frame; constrain it to
   the available form width at 320px without changing working token/JS logic.
   Test real Turnstile on a physical 320px phone before final acceptance. */
@media (max-width: 700px) {
  .ls-turnstile-slot, .ls-turnstile-slot > div { max-width:100%; min-width:0; }
  .ls-turnstile-slot iframe { max-width:100%!important; }
}
