/* daftar.bh · mobile responsive layer (loaded AFTER the desktop styles).
   Everything is scoped to (max-width:900px) so the desktop site is untouched.
   Selectors are tailored to the live DOM: the hero content wrapper is
   [data-dc-tpl="47"], the "shares an account" section is [data-dc-tpl="278"],
   the footer is [data-dc-tpl="307"]. The phone menu, product-carousel wiring
   and story controls are added by mobile.js. */

/* Hidden by default so the desktop header stays untouched · shown only ≤900px. */
.phone-menu-toggle { display: none; }

@keyframes phone-menu-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes phone-menu-exit  { from { transform: translateX(0); } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .phone-menu[open], .phone-menu[open].is-closing { animation: none; }
  #products .ww-step { transition: none; }
}

@media (max-width: 900px) {
  :root {
    --phone-ink: #14261e;
    --phone-green: #1b4332;
    --phone-muted: #52645a;
    --phone-line: #dce6df;
    --phone-gutter: clamp(20px, 5vw, 32px);
  }
  html { height: auto; min-height: 100%; overflow-x: clip; scroll-padding-top: 88px; }
  body { height: auto; min-height: 100%; overflow-x: clip; -webkit-text-size-adjust: 100%; }
  body.phone-menu-open { overflow: hidden; }
  #home > *, #pgv main { min-width: 0; }
  #home :is(h1,h2,h3,p), #pgv :is(h1,h2,h3,p) { overflow-wrap: break-word; }
  :is(a,button,input,textarea,summary):focus-visible { outline: 2px solid #2d6a4f; outline-offset: 4px; }
  #products { scroll-margin-top: 88px; }
  .phone-menu-toggle, .client-story-controls { display: none; }
  .phone-menu:not([open]) { display: none; }

  /* ---- Header (shared shell) ------------------------------------------- */
  .site-header {
    position: sticky !important; top: 0; z-index: 100 !important;
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid rgba(20,38,30,.08);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    animation: none !important;
  }
  .site-header [data-dc-tpl="5"] {
    max-width: none; min-height: 68px;
    padding: 12px var(--phone-gutter) !important;
    display: flex; align-items: center; gap: 12px !important;
  }
  .site-header [data-dc-tpl="6"] { gap: 9px !important; flex-shrink: 0; }
  .site-header [data-dc-tpl="7"] { width: 42px !important; height: 42px !important; border-radius: 12px !important; box-shadow: none !important; }
  .site-header [data-dc-tpl="8"] { font-size: 25px !important; }
  .site-header [data-dc-tpl="11"] { font-size: 22px !important; }
  .site-header [data-dc-tpl="13"] { font-size: 8px !important; letter-spacing: .17em !important; }
  html.mobile-ready .site-header [data-dc-tpl="14"] { display: none !important; }
  .phone-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; flex: 0 0 46px; margin-inline-start: auto; padding: 10px;
    border: 0; border-radius: 12px; background: transparent; color: var(--phone-ink); cursor: pointer;
  }
  .phone-menu-toggle:active { background: rgba(20,38,30,.05); }
  .phone-menu-toggle svg { width: 26px; height: 26px; }

  /* ---- Phone menu (native <dialog>, built by mobile.js) ---------------- */
  .phone-menu[open] {
    display: flex; flex-direction: column; position: fixed; inset: 0 0 0 auto;
    width: min(88vw, 390px); max-width: none; height: 100dvh; margin: 0; padding: 0;
    overflow: hidden; overscroll-behavior: contain;
    border: 0; border-left: 1px solid #e4ebe7; border-radius: 0;
    background: #fff; color: var(--phone-ink);
    box-shadow: 0 24px 80px rgba(9,34,22,.25);
    animation: phone-menu-enter .32s cubic-bezier(.22,.68,0,1);
  }
  .phone-menu[open].is-closing { animation: phone-menu-exit .24s ease-in both; }
  .phone-menu::backdrop { background: rgba(10,27,19,.45); backdrop-filter: blur(4px); }
  .phone-menu-head { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; padding: 16px 22px; border-bottom: 1px solid var(--phone-line); }
  .phone-menu-head [data-dc-tpl="6"] { text-decoration: none; }
  .phone-menu-head [data-dc-tpl="7"] { width: 40px !important; height: 40px !important; box-shadow: none !important; }
  .phone-menu-head [data-dc-tpl="8"] { font-size: 23px !important; }
  .phone-menu-head [data-dc-tpl="11"] { font-size: 22px !important; }
  .phone-menu-head .phone-menu-word { font: 800 1.6rem/1 'DM Sans', sans-serif; letter-spacing: -.04em; }
  .phone-menu-head .phone-menu-word span { color: #e8842b; }
  .phone-menu-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--phone-ink); font-size: 26px; cursor: pointer; }
  .phone-menu-links { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 22px; }
  .phone-menu-links > a, .phone-menu-links > details > summary {
    display: flex; justify-content: space-between; align-items: center;
    min-height: 60px; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--phone-line);
    color: var(--phone-ink); font-size: 1.2rem; font-weight: 700; cursor: pointer; list-style: none;
  }
  .phone-menu-links summary::-webkit-details-marker { display: none; }
  .phone-menu-links summary span.chev { font-size: 22px; font-weight: 400; transition: transform .2s; }
  .phone-menu-links details[open] summary span.chev { transform: rotate(45deg); }
  .phone-menu-products { display: grid; gap: 0; padding: 2px 0 4px; margin: 0; }
  .phone-menu-products a { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; }
  .phone-menu-products a + a { border-top: 1px solid var(--phone-line); }
  .phone-menu-products .pm-name { display: inline-flex; align-items: baseline; gap: 8px; font-size: .95rem; font-weight: 700; color: var(--phone-ink); }
  .phone-menu-products .pm-badge { font-style: normal; font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #2d6a4f; }
  .phone-menu-products a small { font-size: .78rem; font-weight: 500; color: #52645a; line-height: 1.4; }
  .phone-menu-footer { flex: 0 0 auto; padding: 18px 22px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--phone-line); }
  .phone-primary-action { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 16px 20px; border-radius: 14px; background: var(--phone-green); color: #fff; font-size: 1rem; font-weight: 700; }

  /* ---- Hero ------------------------------------------------------------ */
  #home > [data-dc-tpl="23"] {
    min-height: calc(100svh - 68px) !important;
    padding: 64px var(--phone-gutter) !important; text-align: center !important;
  }
  #home [data-dc-tpl="47"] { width: 100%; max-width: 620px !important; margin: 0 auto !important; }
  #home [data-dc-tpl="48"] {
    max-width: 14ch !important; margin: 0 auto !important;
    font-size: clamp(2.5rem, 12vw, 3.5rem) !important; letter-spacing: -.045em !important;
    line-height: 1.06 !important; animation: none !important; text-wrap: balance;
  }
  #home [data-dc-tpl="50"] { max-width: 34ch; margin: 22px auto 0 !important; font-size: 1.0625rem !important; line-height: 1.6 !important; color: var(--phone-muted) !important; animation: none !important; }
  #home [data-dc-tpl="51"] { display: none !important; }
  #home [data-dc-tpl="24"], #home [data-dc-tpl="36"] { width: max(100%, 360px) !important; opacity: .28 !important; animation: none !important; }

  /* ---- Products · tab row + swipe carousel (wired by mobile.js) -------- */
  #products.ww-section { height: auto; }
  #products .ww-sticky { position: static; height: auto; min-height: 0; max-height: none; padding: 44px var(--phone-gutter) 60px; overflow: visible; }
  #products .ww-grid { display: block; max-width: 620px; margin: 0 auto; }
  #products .ww-eyebrow { padding: 0; margin-bottom: 18px; }
  #products .ww-track { display: flex; flex-direction: row; gap: 22px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--phone-line); }
  #products .ww-track::-webkit-scrollbar { display: none; }
  #products .ww-line, #products .ww-node, #products .ww-cell:empty { display: none; }
  #products .ww-step {
    display: flex; flex: 0 0 auto; width: auto; align-items: center; justify-content: center;
    min-width: 0; min-height: 46px; padding: 10px 0 12px; column-gap: 0;
    border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer;
    transition: border-color .15s ease;
  }
  #products .ww-cell { font: 600 .9rem/1.4 'Plus Jakarta Sans', sans-serif; color: #708076; letter-spacing: -.01em; white-space: nowrap; text-align: center; }
  #products .ww-step.is-active { border-bottom-color: var(--phone-green); }
  #products .ww-step.is-active .ww-cell { color: var(--phone-ink); }
  #products .ww-panels {
    display: flex; align-items: stretch; gap: 16px; height: auto;
    width: calc(100% + var(--phone-gutter) * 2); max-width: none;
    margin-inline: calc(var(--phone-gutter) * -1); padding: 0 var(--phone-gutter) 4px;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--phone-gutter); overscroll-behavior-x: contain;
    scrollbar-width: none; touch-action: pan-x pan-y pinch-zoom;
  }
  #products .ww-panels::-webkit-scrollbar { display: none; }
  #products .ww-panel {
    display: flex; flex: 0 0 calc(100% - 16px); position: relative; inset: auto;
    min-width: 0; margin: 0; padding-bottom: 24px; background: #fff;
    border: 1px solid var(--phone-line); border-radius: 20px; overflow: hidden;
    scroll-snap-align: start; scroll-snap-stop: always;
    opacity: 1; transform: none; pointer-events: auto; transition: none;
  }
  #products .ww-media { display: flex; flex-direction: column; height: auto !important; min-height: 0; max-height: none; aspect-ratio: auto !important; overflow: visible !important; border: 0 !important; border-radius: 0; background: #fff !important; box-shadow: none !important; }
  #products .ww-product-photo { position: relative; inset: auto; display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; transform: none; }
  #products .ww-photo-meta { position: static; display: flex; align-items: center; flex-wrap: wrap; width: 100%; padding: 14px 16px; gap: 10px; border-top: 1px solid #edf2ee; }
  #products .ww-photo-name { font-size: 1rem; line-height: 1.35; }
  #products .ww-photo-kicker { font-size: .75rem; line-height: 1.5; margin-top: 3px; }
  #products .ww-photo-status { padding: 5px 9px; background: #edf5ef; border: 0; border-radius: 7px; font-size: .72rem; letter-spacing: 0; text-transform: none; box-shadow: none; }
  #products .ww-title { margin: 22px 20px 0; font-size: clamp(1.5rem, 6.5vw, 1.9rem); line-height: 1.14; letter-spacing: -.03em; }
  #products .ww-desc { max-width: none; margin: 12px 20px 0; font-size: .98rem; line-height: 1.65; color: var(--phone-muted); }
  #products .ww-panels.swipe-dragging { scroll-snap-type: none; }
  .swipe-dragging, .swipe-dragging * { user-select: none !important; }

  /* ---- Business solutions ---------------------------------------------- */
  .business-solutions-section { padding: 60px var(--phone-gutter) !important; }
  .business-solutions-section > div { max-width: 620px !important; text-align: left !important; }
  .business-solutions-section h2 { font-size: clamp(2rem, 8vw, 2.5rem) !important; line-height: 1.1 !important; letter-spacing: -.035em !important; }
  .business-solutions-section p { max-width: none !important; margin-inline: 0 !important; font-size: 1rem !important; line-height: 1.7 !important; }
  .business-solutions-section > div > div:last-child { margin-top: 26px !important; }
  .business-solutions-section a { display: flex !important; align-items: center; justify-content: center; width: 100%; min-height: 54px; padding: 16px !important; }

  /* ---- Client stories · swipe carousel (cs-track built by mobile.js) --- */
  .cs-section { padding: 60px var(--phone-gutter) !important; }
  .cs-grid { display: block !important; max-width: 620px !important; }
  .cs-left { position: static; }
  .cs-left h2 { max-width: 13ch; font-size: clamp(2rem, 8vw, 2.5rem) !important; line-height: 1.08 !important; letter-spacing: -.035em !important; }
  .cs-left p { max-width: 36ch !important; font-size: 1rem !important; line-height: 1.65 !important; }
  .cs-right { margin-top: 26px; display: block; }
  .cs-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% - 24px);
    gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    padding-bottom: 6px; scrollbar-width: none; touch-action: pan-x pan-y pinch-zoom;
  }
  .cs-track::-webkit-scrollbar { display: none; }
  .cs-section .cs-card {
    position: relative !important; top: auto !important; height: auto; min-height: 340px;
    margin: 0 !important; border-radius: 18px;
    transform: none !important; opacity: 1 !important;
    scroll-snap-align: start; scroll-snap-stop: always; box-shadow: none;
  }
  .cs-section .cs-card::before { transform: none; }
  .cs-section .cs-card::after { background: linear-gradient(100deg, rgba(249,251,249,.98), rgba(249,251,249,.83) 42%, rgba(249,251,249,.2)); }
  .cs-section .cs-card-in { padding: 22px 20px 128px; }
  .cs-section .cs-card-in h3 { max-width: 14ch; font-size: 1.5rem !important; line-height: 1.15 !important; }
  .cs-section .cs-card-in p { max-width: 26ch !important; font-size: .9rem !important; line-height: 1.6 !important; }
  .cs-section .cs-brandmark { left: 20px; bottom: 24px; max-width: calc(100% - 40px); }
  .cs-section .cs-client-logo { width: auto; max-width: 100%; max-height: 72px; }
  .cs-mnav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding-top: 18px; }
  .cs-mnav .cs-all { min-height: 44px; display: inline-flex; align-items: center; font-size: .8rem; letter-spacing: .1em; }
  .cs-story-dots { display: flex; align-items: center; gap: 2px; }
  .cs-dot { position: relative; width: 26px; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; }
  .cs-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 999px; background: #cdd8d0; transform: translate(-50%,-50%); transition: width .2s ease, background .2s ease; }
  .cs-dot.is-on::before { width: 20px; background: var(--phone-green); }
  .cs-track.swipe-dragging { scroll-snap-type: none; }

  /* ---- "Everything shares an account" ([data-dc-tpl="278"]) ------------ */
  [data-dc-tpl="278"] { padding: 56px var(--phone-gutter) !important; }
  [data-dc-tpl="279"] { max-width: 620px !important; }
  [data-dc-tpl="280"] { text-align: left !important; margin-bottom: 24px !important; }
  [data-dc-tpl="282"] { max-width: 15ch; font-size: clamp(2rem, 8vw, 2.4rem) !important; line-height: 1.1 !important; }
  [data-dc-tpl="283"] { grid-template-columns: 1fr !important; gap: 0 !important; }
  [data-dc-tpl="283"] > div { display: grid; grid-template-columns: 44px minmax(0,1fr); column-gap: 16px; padding: 22px 0 !important; border: 0 !important; border-bottom: 1px solid var(--phone-line) !important; border-radius: 0 !important; background: transparent !important; }
  [data-dc-tpl="283"] > div > div:first-child { grid-row: 1 / 3; width: 44px !important; height: 44px !important; border-radius: 12px !important; }
  [data-dc-tpl="283"] > div h3 { margin: 0 !important; font-size: 1.15rem !important; line-height: 1.25 !important; }
  [data-dc-tpl="283"] > div p { margin-top: 6px !important; font-size: 1rem !important; line-height: 1.6 !important; color: var(--phone-muted) !important; }

  /* ---- Footer ([data-dc-tpl="307"]) ------------------------------------ */
  [data-dc-tpl="307"] { padding: 48px var(--phone-gutter) max(24px, env(safe-area-inset-bottom)) !important; }
  [data-dc-tpl="308"] { max-width: 620px !important; }
  [data-dc-tpl="309"] { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) !important; gap: 30px 16px !important; padding-bottom: 26px !important; }
  [data-dc-tpl="310"] { grid-column: 1 / -1; }
  [data-dc-tpl="319"] { max-width: 34ch !important; font-size: .875rem !important; line-height: 1.7 !important; }
  [data-dc-tpl="320"] { margin-top: 16px !important; }
  [data-dc-tpl="320"] a { width: 44px !important; height: 44px !important; }
  [data-dc-tpl="307"] :is([data-dc-tpl="328"], [data-dc-tpl="336"]) { gap: 0 !important; }
  [data-dc-tpl="307"] :is([data-dc-tpl="328"], [data-dc-tpl="336"]) a { display: flex; align-items: center; min-height: 44px; font-size: .875rem !important; line-height: 1.4; }
  [data-dc-tpl="349"] { display: block !important; line-height: 1.65; font-size: .75rem !important; }
  [data-dc-tpl="351"] { display: flex !important; flex-wrap: wrap; gap: 0 18px !important; margin-top: 12px; }
  [data-dc-tpl="351"] a { display: flex; align-items: center; min-height: 44px; }

  #home .fx-reveal, #home .fx-soft { opacity: 1 !important; transform: none !important; transition: none !important; }
}

@media (max-width: 359px) {
  :root { --phone-gutter: 16px; }
  #products .ww-cell { font-size: .82rem; }
  [data-dc-tpl="309"] { grid-template-columns: minmax(0,1fr) !important; }
}
