/* ==========================================================================
   Alina — November sale popup (prefix: aqp-promo) — improve-agent #1744
   Dorit's creative (1600×2000, 4:5) is the popup: the image, a copy button on
   the coupon printed in it, and a button under it. Colours are sampled from the
   creative. Everything is scoped to .aqp-promo-root. Theme armor: buttons /
   links get a full !important reset, and every component re-states its visual
   props with !important so the theme can't restyle them.
   ========================================================================== */

.aqp-promo-root {
    --aqp-promo-blue: #4185f4;       /* "מבצע נובמבר" */
    --aqp-promo-blue-dark: #2c6fe0;
    --aqp-promo-navy: #003d90;       /* the price lines */
    --aqp-promo-paper: #f6f9fe;      /* the creative's background */
    --aqp-promo-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --aqp-promo-font: 'aqp-promo-fb', 'FbExtaza', 'Assistant', 'Heebo', Arial, sans-serif;
    /* the coupon pill in the creative, in % of the image (x 599-1001, y 658-757 of 1600×2000) */
    --aqp-promo-pill-x: 37.44%;
    --aqp-promo-pill-y: 32.9%;
    --aqp-promo-pill-w: 25.12%;
    --aqp-promo-pill-h: 4.95%;
    direction: rtl;
    font-family: var(--aqp-promo-font) !important;
}
.aqp-promo-root [hidden] { display: none !important; }

.aqp-promo-root *,
.aqp-promo-root *::before,
.aqp-promo-root *::after { box-sizing: border-box !important; }

/* ---- Layer-2 nuclear reset (interactive elements only) ------------------ */
.aqp-promo-root button,
.aqp-promo-root a {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-family: var(--aqp-promo-font) !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: none !important;
    transform: none !important;
}
.aqp-promo-root img,
.aqp-promo-root svg {
    display: block !important;
    max-width: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.aqp-promo-root button:focus-visible,
.aqp-promo-root a:focus-visible {
    outline: 2px solid var(--aqp-promo-navy) !important;
    outline-offset: 2px !important;
}

/* ---- Overlay + modal ------------------------------------------------------- */
.aqp-promo-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    background: rgba(8, 24, 56, 0.55) !important;
    opacity: 0;
    transition: opacity 200ms var(--aqp-promo-ease-out);
}
.aqp-promo-overlay[hidden] { display: none !important; }
.aqp-promo-overlay.is-open { opacity: 1; }

/* Width: 480px at most, and small enough that image (4:5) + button + the
   close button sticking out fit the screen's height. */
.aqp-promo-modal {
    position: relative !important;
    flex: none !important;
    width: 480px;
    max-width: calc(100vw - 40px);
    border-radius: 18px !important;
    background: var(--aqp-promo-paper) !important;
    box-shadow: 0 24px 60px rgba(4, 22, 60, 0.32) !important;
    outline: none !important;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 260ms var(--aqp-promo-ease-out), transform 260ms var(--aqp-promo-ease-out);
}
@supports (width: min(1px, 2px)) {
    .aqp-promo-modal { width: min(480px, calc(100vw - 40px), calc((100vh - 132px) * 0.8)); max-width: none; }
}
@supports (height: 100dvh) {
    .aqp-promo-modal { width: min(480px, calc(100vw - 40px), calc((100dvh - 132px) * 0.8)); }
}
.aqp-promo-overlay.is-open .aqp-promo-modal { opacity: 1; transform: none; }

/* ---- The image + the coupon ----------------------------------------------- */
.aqp-promo-media {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 18px 18px 0 0 !important;
}
.aqp-promo-root .aqp-promo-img-link { display: block !important; cursor: pointer !important; }
.aqp-promo-root .aqp-promo-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 5;
    background: var(--aqp-promo-paper) !important;
}

/* The copy button covers the coupon pill printed in the image; the icon sits on
   the pill's left end. Its touch area reaches past the (small) pill. */
.aqp-promo-root .aqp-promo-copy {
    position: absolute !important;
    z-index: 2 !important;
    left: var(--aqp-promo-pill-x) !important;
    top: var(--aqp-promo-pill-y) !important;
    width: var(--aqp-promo-pill-w) !important;
    height: var(--aqp-promo-pill-h) !important;
    border-radius: 999px !important;
    cursor: pointer !important;
}
.aqp-promo-root .aqp-promo-copy::before {
    content: '' !important;
    position: absolute !important;
    inset: -10px -8px !important;
}
.aqp-promo-root .aqp-promo-copy-icon {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background: var(--aqp-promo-blue) !important;
    border: 2px solid #fff !important;
    box-shadow: 0 3px 10px rgba(0, 61, 144, 0.3) !important;
    transform: translate(-50%, -50%) !important;
    transition: background-color 160ms ease, scale 140ms var(--aqp-promo-ease-out) !important;
}
.aqp-promo-root .aqp-promo-copy-icon svg {
    width: 16px !important;
    height: 16px !important;
    fill: none !important;
    stroke: #fff !important;
    stroke-width: 2.2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}
.aqp-promo-root .aqp-promo-copy:active .aqp-promo-copy-icon { scale: 0.92; }
@media (hover: hover) and (pointer: fine) {
    .aqp-promo-root .aqp-promo-copy:hover .aqp-promo-copy-icon { background: var(--aqp-promo-blue-dark) !important; }
}

/* "הקופון הועתק בהצלחה!" — right under the coupon. */
.aqp-promo-root .aqp-promo-toast {
    position: absolute !important;
    z-index: 3 !important;
    left: 50% !important;
    top: calc(var(--aqp-promo-pill-y) + var(--aqp-promo-pill-h) + 10px) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    background: var(--aqp-promo-navy) !important;
    color: #fff !important;
    font-family: var(--aqp-promo-font) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    box-shadow: 0 6px 18px rgba(0, 30, 80, 0.28) !important;
    pointer-events: none !important;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity 180ms var(--aqp-promo-ease-out), transform 180ms var(--aqp-promo-ease-out);
}
.aqp-promo-root .aqp-promo-toast:empty { visibility: hidden !important; }
.aqp-promo-root .aqp-promo-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.aqp-promo-root .aqp-promo-toast svg {
    width: 16px !important;
    height: 16px !important;
    fill: none !important;
    stroke: #fff !important;
    stroke-width: 2.6 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* ---- The button under the image -------------------------------------------- */
.aqp-promo-foot {
    padding: 14px 16px 16px !important;
    border-radius: 0 0 18px 18px !important;
    background: var(--aqp-promo-paper) !important;
}
.aqp-promo-root .aqp-promo-cta {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 52px !important;
    padding: 0 20px !important;
    border-radius: 999px !important;
    background: var(--aqp-promo-blue) !important;
    color: #fff !important;
    font-family: var(--aqp-promo-font) !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center !important;
    box-shadow: 0 8px 20px rgba(65, 133, 244, 0.32) !important;
    cursor: pointer !important;
    transition: background-color 160ms ease, scale 140ms var(--aqp-promo-ease-out) !important;
}
.aqp-promo-root .aqp-promo-cta:active { scale: 0.98; }
@media (hover: hover) and (pointer: fine) {
    .aqp-promo-root .aqp-promo-cta:hover { background: var(--aqp-promo-blue-dark) !important; }
}

/* ---- Close: on the corner, outside the creative (its logos are in both top corners) */
.aqp-promo-root .aqp-promo-close {
    position: absolute !important;
    z-index: 4 !important;
    top: -14px !important;
    right: -14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(4, 22, 60, 0.3) !important;
    cursor: pointer !important;
    transition: scale 140ms var(--aqp-promo-ease-out) !important;
}
.aqp-promo-root .aqp-promo-close svg {
    width: 20px !important;
    height: 20px !important;
    fill: none !important;
    stroke: var(--aqp-promo-navy) !important;
    stroke-width: 2.4 !important;
    stroke-linecap: round !important;
}
.aqp-promo-root .aqp-promo-close:active { scale: 0.92; }

/* ---- Mobile ------------------------------------------------------------------ */
@media (max-width: 600px) {
    .aqp-promo-modal { border-radius: 16px !important; }
    @supports (width: min(1px, 2px)) {
        .aqp-promo-modal { width: min(calc(100vw - 32px), calc((100vh - 120px) * 0.8)); }
    }
    @supports (height: 100dvh) {
        .aqp-promo-modal { width: min(calc(100vw - 32px), calc((100dvh - 120px) * 0.8)); }
    }
    .aqp-promo-media { border-radius: 16px 16px 0 0 !important; }
    .aqp-promo-foot { padding: 12px 14px 14px !important; border-radius: 0 0 16px 16px !important; }
    .aqp-promo-root .aqp-promo-cta { height: 48px !important; font-size: 17px !important; }
    .aqp-promo-root .aqp-promo-copy-icon { width: 26px !important; height: 26px !important; }
    .aqp-promo-root .aqp-promo-copy-icon svg { width: 14px !important; height: 14px !important; }
    .aqp-promo-root .aqp-promo-toast { font-size: 13px !important; padding: 7px 12px !important; top: calc(var(--aqp-promo-pill-y) + var(--aqp-promo-pill-h) + 8px) !important; }
    .aqp-promo-root .aqp-promo-close { width: 32px !important; height: 32px !important; top: -12px !important; right: -10px !important; }
    .aqp-promo-root .aqp-promo-close svg { width: 18px !important; height: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .aqp-promo-overlay,
    .aqp-promo-modal,
    .aqp-promo-root .aqp-promo-toast { transition: none !important; }
    .aqp-promo-modal { transform: none !important; }
}
