/* Nov 20 fixes from Scott's iPhone testing (one file, loaded last on every page). */

/* 1. Photo viewer */
html body .lb{touch-action:manipulation;overscroll-behavior:contain;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
html body .lb .lb-stage{position:relative;display:flex;align-items:center;justify-content:center;max-width:100%}
html body .lb.lb-loading .lb-stage img,html body .lb.lb-loading figcaption{visibility:hidden}
html body .lb .lb-wait{display:none;position:absolute;left:50%;top:50%;width:42px;height:42px;margin:-21px 0 0 -21px;border-radius:50%;border:4px solid rgba(255,255,255,.25);border-top-color:#FBE200;animation:gdLbSpin .8s linear infinite}
html body .lb.lb-loading .lb-wait{display:block}
@keyframes gdLbSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){html body .lb .lb-wait{animation:none}}
html body .lb .lb-hint{display:none;margin:0;position:absolute;left:50%;transform:translateX(-50%);bottom:calc(22px + env(safe-area-inset-bottom));color:#C8D3E6;font-size:.82rem;pointer-events:none}
@media (max-width:700px){
  html body .lb .lb-hint{display:block}
  html body .lb.lb-one .lb-hint{display:none}
  html body .lb .lb-prev,html body .lb .lb-next{bottom:calc(12px + env(safe-area-inset-bottom))}
  html body .lb .lb-prev{left:12px}
  html body .lb .lb-next{right:12px}
}
html body .lb .lb-prev,html body .lb .lb-next,html body .lb .lb-close,html body .lb .lb-print{z-index:3;touch-action:manipulation}
/* While the viewer is open nothing underneath can take a tap. */
html.gd-lb-open .m-cta,html.gd-lb-open .gd-mcta{visibility:hidden!important;pointer-events:none!important}
html.gd-lb-open body{overflow:hidden}
html body .g123-lb{touch-action:manipulation;overscroll-behavior:contain}

/* 2. Print from the photo viewer: only the photo and its caption, on one page.
   Applies whenever the viewer is open, so Safari's own Print menu gets the same result. */
@media print{
  @page{margin:12mm}
  html.gd-lb-open,html.gd-print-lightbox,html.gd-lb-open body,html.gd-print-lightbox body{overflow:visible!important;height:auto!important;background:#fff!important}
  html.gd-lb-open body>*:not(.lb),html.gd-print-lightbox body>*:not(.lb){display:none!important}
  html.gd-lb-open body .lb,html.gd-print-lightbox body .lb{position:static!important;inset:auto!important;display:block!important;padding:0!important;margin:0!important;background:#fff!important;height:auto!important;min-height:0!important}
  html.gd-lb-open body .lb figure,html.gd-print-lightbox body .lb figure{display:block!important;width:100%!important;height:auto!important;margin:0!important;break-inside:avoid;page-break-inside:avoid}
  html.gd-lb-open body .lb .lb-stage,html.gd-print-lightbox body .lb .lb-stage{display:block!important}
  html.gd-lb-open body .lb figure img,html.gd-print-lightbox body .lb figure img{display:block!important;visibility:visible!important;width:auto!important;max-width:100%!important;height:auto!important;max-height:230mm!important;margin:0 auto!important;object-fit:contain!important;box-shadow:none!important;border-radius:0!important}
  html.gd-lb-open body .lb figcaption,html.gd-print-lightbox body .lb figcaption{visibility:visible!important;color:#111!important;font-size:11pt!important;margin-top:4mm!important;text-align:center}
  html.gd-lb-open body .lb .lb-count,html.gd-lb-open body .lb button,html.gd-lb-open body .lb .lb-hint,html.gd-lb-open body .lb .lb-wait,
  html.gd-print-lightbox body .lb .lb-count,html.gd-print-lightbox body .lb button,html.gd-print-lightbox body .lb .lb-hint,html.gd-print-lightbox body .lb .lb-wait{display:none!important}
}

/* 8. Sticky bottom bar (.m-cta) stays pinned to the bottom edge with Safari's
   moving toolbar: fixed to bottom:0, safe-area padding, no vh math, no transforms. */
html{touch-action:manipulation}
@media (max-width:760px){
  html body nav.m-cta{position:fixed!important;top:auto!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;transform:none!important;translate:none!important;will-change:auto!important;height:auto!important;max-height:none!important;padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;box-sizing:border-box}
  /* hide it while the phone keyboard is up or the page is pinch zoomed, the two
     cases where iOS shows a fixed bar in the middle of the screen */
  html.gd-kb-open body nav.m-cta,html.gd-zoomed body nav.m-cta{display:none!important}
}

/* 9. Dome pages: the photo column beside the text. One rule for every dome page
   and every viewport. Two columns (wider than 820px, phones in landscape and up):
   the photo starts at the top of its column and stays in view from the first
   line of text. One column (phones in portrait): the photo sits first, full
   width, and scrolls normally with the page. */
@media (min-width:821px){
  html body main .split:has(>[style*="sticky"]){align-items:start!important}
  html body main .split>[style*="sticky"]{
    position:-webkit-sticky!important;position:sticky!important;
    top:calc(var(--header-h,72px) + 24px)!important;
    align-self:start!important;margin-top:0!important;transform:none!important
  }
}
@media (max-width:820px){
  html body main .split>[style*="sticky"]{
    position:relative!important;top:auto!important;order:-1!important;align-self:stretch!important;transform:none!important
  }
}

/* 11. QR tap to share */
html body img.gd-qr-tap{cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .15s ease}
html body img.gd-qr-tap:hover{transform:scale(1.04)}
html body img.gd-qr-tap:focus-visible{outline:3px solid #FBE200;outline-offset:3px}
@media (prefers-reduced-motion:reduce){html body img.gd-qr-tap{transition:none}html body img.gd-qr-tap:hover{transform:none}}
html body .gd-qr-modal{position:fixed;inset:0;z-index:600;background:rgba(0,47,108,.82);display:flex;align-items:center;justify-content:center;padding:20px;touch-action:manipulation}
html body .gd-qr-modal[hidden]{display:none}
html body .gd-qr-card{position:relative;background:#fff;color:#333F48;border-radius:20px;border:3px solid #FBE200;box-shadow:0 24px 60px rgba(0,0,0,.35);padding:28px 28px 22px;max-width:400px;width:100%;text-align:center}
html body .gd-qr-card h2{margin:0 0 14px;color:#002F6C;font-size:1.35rem}
html body .gd-qr-big{display:block;width:min(320px,100%);height:auto;margin:0 auto;image-rendering:pixelated;border-radius:8px;background:#fff}
html body .gd-qr-link{margin:12px 0 14px;font-weight:700;color:#002F6C;word-break:break-all}
html body .gd-qr-actions{display:flex;justify-content:center}
html body .gd-qr-copy{min-width:160px}
html body .gd-qr-status{min-height:1.4em;margin:10px 0 0;font-size:.9rem;color:#333F48}
html body .gd-qr-x{position:absolute;top:10px;right:10px;width:40px;height:40px;border-radius:999px;border:2px solid #002F6C;background:#fff;color:#002F6C;font-size:1.4rem;line-height:1;cursor:pointer}
html body .gd-qr-x:focus-visible,html body .gd-qr-copy:focus-visible{outline:3px solid #FBE200;outline-offset:2px}
html.gd-qr-open .m-cta{visibility:hidden!important}
@media print{html body img.gd-qr-tap{transform:none!important}.gd-qr-modal{display:none!important}}

/* 12a. Country first: searchable list */
html body form .gd-country-first{margin-bottom:14px}
html body form .gd-buyer-row{margin-bottom:4px}
html body .gd-cb{position:relative}
html body .gd-cb input[role="combobox"]{padding-right:40px}
html body .gd-cb .gd-cb-caret{position:absolute;right:14px;top:50%;width:10px;height:10px;margin-top:-8px;border-right:2.5px solid #002F6C;border-bottom:2.5px solid #002F6C;transform:rotate(45deg);pointer-events:none}
html body .gd-cb.open .gd-cb-caret{transform:rotate(-135deg);margin-top:-3px}
html body .gd-cb-list{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:60;margin:0;padding:6px;list-style:none;max-height:min(300px,50svh);overflow-y:auto;-webkit-overflow-scrolling:touch;background:#fff;border:2px solid #002F6C;border-radius:12px;box-shadow:0 14px 34px rgba(0,47,108,.22)}
html body .gd-cb-list[hidden]{display:none}
html body .gd-cb-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;color:#333F48;cursor:pointer;font-size:1rem;line-height:1.3}
html body .gd-cb-list li small{color:#5B6770;font-weight:600;white-space:nowrap}
html body .gd-cb-list li.on,html body .gd-cb-list li:hover{background:#FFF6B3;color:#002F6C}
html body .gd-cb-list li.gd-cb-none{cursor:default;background:none;color:#5B6770}

/* 12b. Compact thank-you, the same on every form and confirmation */
html body .thanks.gd-thanks,html body .gd120-status.gd-thanks{display:none;align-items:flex-start;gap:12px;margin:14px 0 0;padding:14px 16px!important;border-radius:14px!important;background:#F1FAF4!important;border:1.5px solid #1E8E4E!important;color:#333F48!important;font-weight:400;text-align:left;box-shadow:none}
html body form.sent+.thanks.gd-thanks,html body .gd120-status.gd-thanks.on{display:flex!important}
html body .gd-thanks .gd-thanks-check{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#1E8E4E;color:#fff;margin-top:1px}
html body .gd-thanks .gd-thanks-check svg{width:16px;height:16px;display:block}
html body .gd-thanks .gd-thanks-body{min-width:0;flex:1}
html body .gd-thanks .gd-thanks-body b{display:block;margin:0 0 4px;color:#0B3D24!important;font-size:1.02rem;line-height:1.35;font-weight:800}
html body .gd-thanks .gd-thanks-body p{margin:0 0 10px!important;color:#333F48!important;font-size:.95rem!important;line-height:1.45;font-weight:400}
html body .gd-thanks .gd-thanks-body a{color:#002F6C!important;font-weight:700;text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
html body .gd-thanks .gd120-ref{display:block;margin:0 0 6px;font-size:.8rem;color:#3E5A4B}
html body .gd-thanks .gd-thanks-back{margin:0;padding:8px 16px;font-size:.92rem;min-height:40px;background:#fff!important;color:#002F6C!important;border:2px solid #002F6C!important;border-radius:999px}
html body .gd-thanks .gd-thanks-back:focus-visible{outline:3px solid #FBE200;outline-offset:2px}
html body .gd-thanks:focus{outline:none}
html body .gd-thanks>svg{display:none}
html body .gd-thanks .gd-thanks-mail{display:inline-flex;margin:0 8px 8px 0;padding:8px 16px;min-height:40px;font-size:.92rem;border-radius:999px}

/* 12c. Nov 20 (b): Country and Phone on the community and distributor feedback forms */
html body .gd-fb-contact{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0 0 16px}
html body .gd-fb-contact .gd-country-first{margin:0}
html body .gd-fb-contact input{width:100%;box-sizing:border-box}
@media (max-width:600px){html body .gd-fb-contact{grid-template-columns:1fr}}
html body form#g6-share .gd-country-first,html body form#g97-idea-form .gd-country-first{display:block;margin:0 0 14px}
html body form#g6-share .gd-country-first label,html body form#g6-share .gd-phone-field label,html body form#g97-idea-form .gd-country-first label,html body form#g97-idea-form .gd-phone-field label{display:block}
html body form#g6-share .gd-country-first input,html body form#g6-share .gd-phone-field input,html body form#g97-idea-form .gd-country-first input,html body form#g97-idea-form .gd-phone-field input{width:100%;box-sizing:border-box}
/* the dark distributor pages force light text; keep the thank-you readable there */
html:not(#gdn1):not(#gdn2):not(#gdn3) body:not(#gdn1):not(#gdn2):not(#gdn3) .gd-thanks .gd-thanks-body b{color:#0B3D24!important}
html:not(#gdn1):not(#gdn2):not(#gdn3) body:not(#gdn1):not(#gdn2):not(#gdn3) .gd-thanks .gd-thanks-body p{color:#333F48!important}
html:not(#gdn1):not(#gdn2):not(#gdn3) body:not(#gdn1):not(#gdn2):not(#gdn3) .gd-thanks .gd-thanks-body a:not(.btn){color:#002F6C!important}
html:not(#gdn1):not(#gdn2):not(#gdn3) body:not(#gdn1):not(#gdn2):not(#gdn3) .gd-thanks .gd-thanks-back{background:#fff!important;color:#002F6C!important;border:2px solid #002F6C!important}
