/* ===========================================================================
   Sniper - pop-ups (shared/js/popups.js), set up in Admin > Pop-ups.
   The admin's preview loads this same file, so what is designed there is what
   the store shows. Every colour comes from the pop-up's own design
   (--pop-bg, --pop-fg, --pop-acc, --pop-acc-fg, --pop-stub): one pop-up looks
   the same on Sniper Shopping and Sniper Safety.

   Layouts:  ticket  coupon stub (logo + the big number) beside the words
             split   picture beside the words
             top     picture above the words
             image   the picture is the pop-up (a designed banner), buttons below
             text    words only
   Where:    center (a window), bottom (a sheet along the bottom), corner
             (a small card in the corner, the page stays usable)
   =========================================================================== */
@font-face{font-family:"Oswald";src:url("../fonts/Oswald-Variable.woff2") format("woff2-variations"),url("../fonts/Oswald-Variable.woff2") format("woff2");
  font-weight:200 700;font-style:normal;font-display:swap}
@font-face{font-family:"Sniper Arabic";src:url("../fonts/NaskhArabicBold.woff2") format("woff2");font-weight:100 900;font-style:normal;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF}

.pop{--pop-bg:#FFFFFF;--pop-fg:#111111;--pop-acc:#FF752B;--pop-acc-fg:#FFFFFF;--pop-stub:#FFF5EE;
  --pop-w:560px;--pop-r:14px;--pop-stub-w:240px;--pop-font:"Sniper Arabic","Oswald","Segoe UI",system-ui,sans-serif;
  position:fixed;inset:0;z-index:240;display:flex;align-items:center;justify-content:center;padding:16px;visibility:hidden;
  font-family:var(--pop-font);line-height:1.4;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.pop *,.pop *::before,.pop *::after{box-sizing:border-box}
.pop.open{visibility:visible}
.pop--small{--pop-w:400px;--pop-stub-w:200px}
.pop--medium{--pop-w:560px}
.pop--large{--pop-w:780px;--pop-stub-w:260px}
.pop--c-square{--pop-r:0px}
.pop--c-round{--pop-r:14px}
.pop--c-soft{--pop-r:28px}

.pop__scrim{position:absolute;inset:0;background:rgba(11,11,12,.62);opacity:0;transition:opacity .3s ease}
.pop--o-light .pop__scrim{background:rgba(11,11,12,.28)}
.pop--o-none .pop__scrim{background:transparent}
.pop.open .pop__scrim{opacity:1}

.pop__panel{position:relative;display:flex;flex-direction:column;width:min(var(--pop-w),100%);
  max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);background:var(--pop-bg);color:var(--pop-fg);
  border-radius:var(--pop-r);overflow:hidden;outline:none;box-shadow:0 24px 70px rgba(0,0,0,.28);
  opacity:0;transform:translateY(18px) scale(.98);transition:opacity .3s ease,transform .35s cubic-bezier(.2,.7,.3,1)}
.pop.open .pop__panel{opacity:1;transform:none}
.pop__x{position:absolute;top:12px;inset-inline-end:12px;z-index:3;display:grid;place-items:center;width:36px;height:36px;padding:0;
  border:0;border-radius:50%;background:rgba(255,255,255,.92);color:#111;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.12)}
.pop__x:hover{background:#fff}
.pop__x svg{width:18px;height:18px}

.pop__body{flex:1 1 auto;min-width:0;padding:34px 34px 22px;overflow-y:auto;overscroll-behavior:contain}
.pop__logo{display:block;width:120px;max-width:60%;height:auto;margin:0 0 14px}
.pop__kicker{margin:0 0 8px;font-size:12px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--pop-acc)}
.pop__title{margin:0 0 10px;padding-inline-end:28px;font-family:var(--pop-font);font-size:26px;line-height:1.15;font-weight:600;
  text-transform:uppercase;letter-spacing:.01em;color:var(--pop-fg);text-wrap:balance}
.pop__title bdi{color:var(--pop-acc)}
.pop__text{margin:0 0 18px;font-size:14px;line-height:1.6;opacity:.86}
.pop__text p{margin:0 0 8px}
.pop__text p:last-child{margin:0}
.pop__note{margin:12px 0 0;font-size:12px;line-height:1.5;opacity:.7}

/* buttons and the form */
.pop__btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:50px;padding:12px 18px;border:0;border-radius:min(var(--pop-r),10px);
  background:var(--pop-acc);color:var(--pop-acc-fg);font:600 15px/1.25 var(--pop-font);letter-spacing:.06em;text-transform:uppercase;
  text-align:center;text-decoration:none;cursor:pointer;transition:filter .15s ease,transform .15s ease}
.pop__btn:hover{filter:brightness(.94);transform:translateY(-1px)}
.pop__btn:disabled{opacity:.65;cursor:default;transform:none;filter:none}
.pop__btn--line{background:transparent;color:var(--pop-fg);border:1.5px solid currentColor}
.pop__btn + .pop__btn{margin-top:10px}
.pop__skip{display:block;margin:6px auto 0;padding:6px 10px;border:0;background:none;color:inherit;opacity:.7;font:inherit;font-size:12.5px;
  text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.pop__skip:hover{opacity:1}
.pop__alt{margin:14px 0 0;text-align:center;font-size:13px;opacity:.85}
.pop__alt a,.pop__alt button{padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.pop__fld{display:block;margin-bottom:12px}
.pop__fld span{display:block;margin-bottom:5px;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;opacity:.7}
.pop__fld input{width:100%;padding:11px 13px;border:1px solid rgba(0,0,0,.18);border-radius:min(var(--pop-r),8px);
  font:inherit;font-size:16px;background:#fff;color:#111}
.pop__fld input:focus{outline:none;border-color:var(--pop-acc);box-shadow:0 0 0 3px rgba(255,117,43,.18)}
.pop__fld input.is-bad{border-color:#C62828;box-shadow:0 0 0 3px rgba(198,40,40,.1)}
.pop__fld small{display:block;margin-top:5px;font-size:11.5px;opacity:.7}
.pop__fld small.fld-err{color:#C62828;opacity:1;font-weight:500}
.pop__check{display:flex;align-items:flex-start;gap:9px;margin:0 0 14px;font-size:13px;line-height:1.45;cursor:pointer}
.pop__check input{width:17px;height:17px;margin:1px 0 0;flex:none;accent-color:var(--pop-acc)}
.pop__msg{margin:0;font-size:13px;line-height:1.45;color:#C62828}
.pop__msg.is-on{margin:0 0 10px}
.pop__msg.is-ok{color:#1E9E62}
.pop .gbtn{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:46px;padding:10px 16px;
  background:#fff;color:#1F1F1F;border:1px solid #747775;border-radius:min(var(--pop-r),8px);font:500 14.5px/1.2 Roboto,Inter,Arial,sans-serif;text-decoration:none}
.pop .gbtn:hover{background:#F8FAFF;box-shadow:0 1px 3px rgba(60,64,67,.25)}
.pop .gbtn__g{width:20px;height:20px;flex:none}
.pop__or{display:flex;align-items:center;gap:12px;margin:14px 0;font-size:12px;text-transform:uppercase;letter-spacing:.08em;opacity:.6}
.pop__or::before,.pop__or::after{content:"";flex:1;height:1px;background:currentColor;opacity:.35}

/* the code */
.pop__ok{display:grid;place-items:center;width:46px;height:46px;margin-bottom:14px;border-radius:50%;background:rgba(30,158,98,.14);color:#1E9E62}
.pop__ok svg{width:22px;height:22px}
.pop__body{container-type:inline-size}
.pop__code{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:4px 0 14px;padding:10px;padding-inline-start:18px;border:2px dashed var(--pop-acc);
  border-radius:min(var(--pop-r),12px);background:var(--pop-stub);color:#111}
.pop__code b{flex:1 1 auto;min-width:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:22px;font-size:clamp(15px,6.4cqi,22px);
  font-weight:700;letter-spacing:.04em;white-space:nowrap;-webkit-user-select:all;user-select:all}
.pop__copy{flex:none;min-width:72px;padding:11px 14px;border:0;border-radius:min(var(--pop-r),8px);background:#111;color:#fff;
  font:600 14px/1 var(--pop-font);letter-spacing:.06em;text-transform:uppercase;cursor:pointer}
.pop__copy.is-done{background:#1E9E62}
.pop__fine{margin:0 0 16px;font-size:13px;line-height:1.55;opacity:.75}

/* ---- pictures ---- */
.pop__media{position:relative;flex:none;background:var(--pop-stub);overflow:hidden}
.pop__media img{display:block;width:100%;height:100%;object-fit:var(--pop-fit,cover)}
.pop__media a{display:block;height:100%}
.pop--top .pop__media{height:210px}
.pop--large.pop--top .pop__media{height:260px}
.pop--split .pop__panel{flex-direction:row}
.pop--split.pop--side-end .pop__panel{flex-direction:row-reverse}
.pop--split .pop__media{width:42%;min-height:100%}
.pop--image .pop__media{height:auto;background:transparent}
.pop--image .pop__media img{height:auto;max-height:68vh;max-height:68dvh;object-fit:contain}
.pop--image .pop__body{padding:16px 22px 14px}
.pop--image .pop__body:empty{display:none}

/* ---- the coupon ticket ---- */
.pop--ticket .pop__panel{flex-direction:row;
  --cx:calc(var(--pop-stub-w) - 1px);
  -webkit-mask:radial-gradient(circle 13px at var(--cx) 0,#0000 96%,#000) top/100% 51% no-repeat,
               radial-gradient(circle 13px at var(--cx) 100%,#0000 96%,#000) bottom/100% 51% no-repeat;
  mask:radial-gradient(circle 13px at var(--cx) 0,#0000 96%,#000) top/100% 51% no-repeat,
       radial-gradient(circle 13px at var(--cx) 100%,#0000 96%,#000) bottom/100% 51% no-repeat}
[dir="rtl"] .pop--ticket .pop__panel{--cx:calc(100% - var(--pop-stub-w) + 1px)}
.pop__stub{flex:0 0 var(--pop-stub-w);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:30px 18px;text-align:center;
  background:var(--pop-stub);color:#111;border-inline-end:2px dashed var(--pop-acc);min-width:0}
.pop__stub .pop__logo{width:140px;max-width:100%;margin:0 0 10px}
.pop__big{display:flex;flex-direction:column;align-items:center;line-height:.9;color:var(--pop-acc)}
.pop__big b{font-family:var(--pop-font);font-size:clamp(40px,calc(var(--pop-stub-w) / 2.4),100px);font-weight:700;letter-spacing:-.02em;overflow-wrap:anywhere}
.pop__big--m b{font-size:clamp(34px,calc(var(--pop-stub-w) / 3.8),64px)}
.pop__big--s b{font-size:clamp(26px,calc(var(--pop-stub-w) / 5.6),44px)}
.pop__big span{margin-top:8px;font-size:15px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#111}
.pop__big--ar span{margin:0 0 8px}
.pop__sites{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:12px 0 0}
.pop__sites span{padding:4px 10px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#fff;background:#FF752B}
.pop__sites span.is-safety{background:#182957}

/* stacked: the ticket's stub and a side picture go on top (small pop-ups, the corner, phones) */
.pop--stack.pop--split .pop__panel,.pop--stack.pop--ticket .pop__panel{flex-direction:column}
.pop--stack.pop--split .pop__media{width:100%;height:170px;min-height:0}
.pop--stack.pop--ticket .pop__panel{-webkit-mask:radial-gradient(circle 12px at 0 104px,#0000 96%,#000) left/51% 100% no-repeat,
    radial-gradient(circle 12px at 100% 104px,#0000 96%,#000) right/51% 100% no-repeat;
  mask:radial-gradient(circle 12px at 0 104px,#0000 96%,#000) left/51% 100% no-repeat,
    radial-gradient(circle 12px at 100% 104px,#0000 96%,#000) right/51% 100% no-repeat}
.pop--stack .pop__stub{flex:0 0 104px;height:104px;flex-direction:row;justify-content:flex-start;gap:14px;padding:12px 18px;padding-inline-end:56px;
  text-align:start;border-inline-end:0;border-bottom:2px dashed var(--pop-acc)}
.pop--stack .pop__stub .pop__logo{width:78px;margin:0}
.pop--stack .pop__big{flex-direction:row;align-items:baseline;gap:8px}
.pop--stack .pop__big b{font-size:54px}
.pop--stack .pop__big--m b{font-size:40px}
.pop--stack .pop__big--s b{font-size:30px}
.pop--stack .pop__big span{margin:0;font-size:14px}
.pop--stack .pop__big--ar span{margin:0}
.pop--stack .pop__sites{display:none}

/* ---- where it sits ---- */
.pop--bottom{align-items:flex-end;padding:0}
.pop--bottom .pop__panel{border-radius:var(--pop-r) var(--pop-r) 0 0;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);
  padding-bottom:env(safe-area-inset-bottom,0px);transform:translateY(40px)}
.pop--corner{inset:auto;bottom:16px;inset-inline-end:16px;display:block;padding:0;width:min(380px,calc(100vw - 32px));
  margin-bottom:env(safe-area-inset-bottom,0px)}
.pop--corner .pop__scrim{display:none}
.pop--corner .pop__panel{width:100%;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);transform:translateY(24px)}
.pop--corner .pop__body{padding:24px 22px 16px}
.pop--corner .pop__title{font-size:20px}

/* the words in Arabic: letters join up, no spacing between them */
[dir="rtl"] .pop__kicker,[dir="rtl"] .pop__btn,[dir="rtl"] .pop__big span,[dir="rtl"] .pop__copy,[dir="rtl"] .pop__fld span,[dir="rtl"] .pop__title{letter-spacing:0}

/* phones */
@media (max-width:639px){
  .pop{padding:12px}
  .pop--bottom,.pop--corner{padding:0}
  .pop__body{padding:22px 20px 14px}
  .pop__title{font-size:21px;padding-inline-end:0}
  .pop__text{font-size:13.5px;margin-bottom:14px}
  .pop__fld{margin-bottom:10px}
  .pop__fld input{padding:10px 12px}
  .pop__or{margin:12px 0}
  .pop--top .pop__media{height:160px}
  .pop--split .pop__panel,.pop--ticket .pop__panel{flex-direction:column}
  .pop--split .pop__media{width:100%;height:160px;min-height:0}
  .pop--ticket .pop__panel{-webkit-mask:radial-gradient(circle 12px at 0 104px,#0000 96%,#000) left/51% 100% no-repeat,
      radial-gradient(circle 12px at 100% 104px,#0000 96%,#000) right/51% 100% no-repeat;
    mask:radial-gradient(circle 12px at 0 104px,#0000 96%,#000) left/51% 100% no-repeat,
      radial-gradient(circle 12px at 100% 104px,#0000 96%,#000) right/51% 100% no-repeat}
  .pop--ticket .pop__stub{flex:0 0 104px;height:104px;flex-direction:row;justify-content:flex-start;gap:14px;padding:12px 18px;padding-inline-end:56px;
    text-align:start;border-inline-end:0;border-bottom:2px dashed var(--pop-acc)}
  .pop--ticket .pop__stub .pop__logo{width:78px;margin:0}
  .pop--ticket .pop__big{flex-direction:row;align-items:baseline;gap:8px}
  .pop--ticket .pop__big b{font-size:54px}
  .pop--ticket .pop__big--m b{font-size:40px}
  .pop--ticket .pop__big--s b{font-size:30px}
  .pop--ticket .pop__big span{margin:0;font-size:14px}
  .pop--ticket .pop__sites{display:none}
  .pop--corner{inset-inline-end:12px;bottom:12px;width:calc(100vw - 24px)}
}
@media (prefers-reduced-motion:reduce){.pop__panel,.pop__scrim{transition:none}}
