/* ScriptiQ Studio — mobile e-commerce layer (2026-07 redesign).
   CONTRACT: desktop must be untouched. The ONLY top-level rule in this file
   is the `.m-only` hide (which affects desktop solely by hiding elements
   that exist only for phones). Everything else lives inside the single
   @media (max-width: 640px) block. Loaded LAST on every public page. */

.m-only {
  display: none !important;
}

@media (max-width: 640px) {
  /* ---- utilities ------------------------------------------------------ */
  .m-only { display: block !important; }
  .m-only.m-flex { display: flex !important; }
  .m-only.m-grid { display: grid !important; }
  .m-hide { display: none !important; }

  /* ---- storefront product cards (index.html) -------------------------- */
  .m-shop { margin: 34px 0 8px; }
  .m-shop-head {
    margin-bottom: 4px;
    color: var(--muted, #a1aaa9);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .m-shop-title {
    margin: 0 0 16px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--ink, #fff6ea);
  }
  .m-prod {
    position: relative;
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
    border-radius: 16px;
    padding: 18px 16px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
      rgba(18, 23, 24, 0.85);
    text-decoration: none;
    color: inherit;
  }
  .m-prod.m-featured {
    border-color: rgba(255, 122, 61, 0.55);
    background:
      linear-gradient(180deg, rgba(255, 122, 61, 0.22), rgba(255, 122, 61, 0.05) 42%, rgba(255, 255, 255, 0.04)),
      #1a2021;
  }
  .m-prod-badge {
    position: absolute;
    top: -9px;
    right: 14px;
    border-radius: 999px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #d9521f, #ec7536);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .m-prod-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
  .m-prod-name {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--ink, #fff6ea);
  }
  .m-prod-price { text-align: right; flex: 0 0 auto; }
  .m-prod-price .m-from {
    display: block;
    color: var(--muted, #a1aaa9);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .m-prod-price .m-amount {
    color: #ffb36d;
    font-size: 1.2rem;
    font-weight: 900;
  }
  .m-prod-desc {
    margin: 8px 0 10px;
    color: var(--muted, #a1aaa9);
    font-size: 0.9rem;
    line-height: 1.55;
  }
  .m-prod-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffb36d;
    font-size: 0.85rem;
    font-weight: 800;
  }

  /* ---- honest assurance strip ----------------------------------------- */
  .m-assure {
    display: grid;
    gap: 8px;
    margin: 18px 0 6px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
    border-radius: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.045);
  }
  .m-assure-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted, #c2c9c6);
    font-size: 0.85rem;
    font-weight: 700;
  }
  .m-assure-row::before {
    content: "\2713";
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(107, 214, 161, 0.16);
    color: #9bf0c2;
    font-size: 0.7rem;
    font-weight: 900;
  }

  /* ---- sticky bottom buy/continue bar ---------------------------------- */
  body.m-bar-pad { padding-bottom: 86px; }
  .m-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 12, 14, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(110%);
    transition: transform 0.18s ease;
  }
  .m-bar.m-bar-show { transform: translateY(0); }
  .m-bar-info { min-width: 0; }
  .m-bar-label {
    display: block;
    color: var(--muted, #a1aaa9);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-bar-price {
    display: block;
    color: var(--ink, #fff6ea);
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.2;
  }
  .m-bar .btn { width: auto; flex: 0 0 auto; min-height: 48px; white-space: nowrap; }

  /* (bundle.html and choose.html carry their own inline styles so they
     render at every width; this file only ships their phone-only widgets
     like the sticky bar.) */

  /* ---- start.html selection chip + notes toggle ------------------------- */
  .m-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 122, 61, 0.4);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 122, 61, 0.1);
  }
  .m-chip-text { min-width: 0; color: var(--ink, #fff6ea); font-size: 0.9rem; font-weight: 800; }
  .m-chip-text small {
    display: block;
    color: var(--muted, #c2c9c6);
    font-size: 0.78rem;
    font-weight: 700;
  }
  .m-chip-change {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink, #fff6ea);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
  }
  /* While the chip is active, the raw selects it summarizes stay hidden. */
  form.m-chip-active .field-package,
  form.m-chip-active .field-wordcount { display: none; }
  /* Notes collapsed behind a toggle until opened. */
  form.m-has-notes-toggle .field.full { display: none; }
  form.m-has-notes-toggle.m-notes-open .field.full { display: grid; }
  .m-notes-btn {
    width: 100%;
    margin: 2px 0 12px;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    padding: 12px 14px;
    background: none;
    color: var(--muted, #c2c9c6);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
  }

  /* ---- pricing page: "Full details" card link + 50/50 note --------------- */
  .bundle-detail-link {
    margin-top: 10px;
    color: #ffb36d;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
  }
  .m-pay-note {
    margin: 2px 0 12px;
    color: #9bf0c2;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.55;
  }

  /* ---- checkout: UPI app chips + UTR help ------------------------------- */
  .m-upichips { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 4px; }
  .m-upichip:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .m-upichip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 11px 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink, #fff6ea);
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
  }
  .m-utrhelp {
    margin: 10px 0 4px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
  }
  .m-utrhelp > summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
    color: #ffb36d;
    font-size: 0.88rem;
    font-weight: 800;
    user-select: none;
  }
  .m-utrhelp > summary::-webkit-details-marker { display: none; }
  .m-utrhelp-body { padding: 0 14px 12px; color: var(--muted, #c2c9c6); font-size: 0.85rem; line-height: 1.6; }
  .m-utrhelp-body p { margin: 0 0 8px; }

  /* ---- success.html verification timeline ------------------------------- */
  .m-timeline { margin: 18px 0 6px; display: grid; gap: 0; }
  .m-tstep {
    position: relative;
    padding: 0 0 18px 30px;
    color: var(--muted, #c2c9c6);
    font-size: 0.9rem;
    font-weight: 700;
  }
  .m-tstep::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
  }
  .m-tstep::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 19px;
    bottom: 2px;
    width: 2px;
    background: rgba(255, 255, 255, 0.12);
  }
  .m-tstep:last-child { padding-bottom: 0; }
  .m-tstep:last-child::after { display: none; }
  .m-tstep.m-tdone::before {
    background: #9bf0c2;
    box-shadow: 0 0 12px rgba(107, 214, 161, 0.55);
  }
  .m-tstep.m-tnow::before {
    background: linear-gradient(135deg, #f15a32, #f8a640);
    box-shadow: 0 0 12px rgba(255, 122, 61, 0.6);
  }
  .m-tstep.m-tnow { color: var(--ink, #fff6ea); }
  .m-tstep small { display: block; color: var(--muted-2, #8f9997); font-weight: 600; font-size: 0.78rem; }

  /* ---- homepage: hero price anchor + static "How it works" steps -------- */
  .m-price-anchor {
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    border: 1px solid rgba(255, 122, 61, 0.32);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 122, 61, 0.09);
    color: var(--muted, #c2c9c6);
    font-size: 0.85rem;
    font-weight: 700;
  }
  .m-price-anchor strong { color: #ffb36d; font-size: 1rem; font-weight: 900; }
  .m-how { margin: 8px 0 12px; }
  .m-steps { display: grid; }
  .m-step {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 0 0 20px;
  }
  .m-step::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 37px;
    bottom: 3px;
    width: 2px;
    background: rgba(255, 255, 255, 0.12);
  }
  .m-step:last-child { padding-bottom: 0; }
  .m-step:last-child::before { display: none; }
  .m-step-num {
    flex: 0 0 auto;
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #f15a32, #f8a640);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 900;
  }
  .m-step strong { display: block; color: var(--ink, #fff6ea); font-size: 0.95rem; font-weight: 800; line-height: 1.35; }
  .m-step small { display: block; margin-top: 2px; color: var(--muted, #a1aaa9); font-size: 0.82rem; line-height: 1.5; }

  /* ---- bottom navigation bar + "More" sheet ------------------------------ */
  /* The three-lines toggle disappears on phones: navigation lives in the
     bottom bar (or, on funnel pages, doesn't compete with the buy bar).
     Desktop (>640px) keeps the full top nav untouched. */
  .site-header .nav-toggle,
  body > header .nav-toggle { display: none !important; }

  body.m-nav-pad { padding-bottom: 84px; }
  .m-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 12, 14, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .m-nav-item {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 8px 2px 7px;
    border: 0;
    background: none;
    color: var(--muted, #a1aaa9);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
  }
  .m-nav-icon { display: block; }
  .m-nav-icon svg { display: block; width: 22px; height: 22px; }
  .m-nav-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
  }
  .m-nav-item.m-nav-active { color: #ffb36d; }
  .m-nav-item.m-nav-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(135deg, #f15a32, #f8a640);
  }
  .m-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 94;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .m-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 96;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: #12181a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  body.m-sheet-open .m-sheet-scrim { opacity: 1; pointer-events: auto; }
  body.m-sheet-open .m-sheet { opacity: 1; transform: none; pointer-events: auto; }
  .m-sheet a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--ink, #fff6ea);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
  }
  .m-sheet a:last-child { border-bottom: 0; }
}
