/* Dynamically mounted promotion dialog. The public page has no hidden dialog DOM. */
body.promo-modal-open { overflow: hidden !important; }
/* The overlay stays mounted until the closing transition finishes. */
.promo-modal-overlay {
    position: fixed; inset: 0; z-index: 200000;
    display: flex; justify-content: center; align-items: center; padding: 22px;
    background: rgba(0,0,0,.72);
    opacity: 0; visibility: hidden;
    -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
    transition: opacity 280ms ease, -webkit-backdrop-filter 280ms ease, backdrop-filter 280ms ease, visibility 0s linear 320ms;
}
.promo-modal-overlay.is-open {
    opacity: 1; visibility: visible;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transition: opacity 280ms ease, -webkit-backdrop-filter 280ms ease, backdrop-filter 280ms ease, visibility 0s linear 0s;
}
.promo-modal-panel {
    position: relative; isolation: isolate;
    width: min(700px, calc(100vw - 44px), calc(90dvh - 48px));
    max-height: 90dvh; overflow-y: auto; border-radius: 17px;
    background: var(--promo-bg, #fff); color: var(--promo-fg, #191919);
    box-shadow: 0 32px 100px rgba(0,0,0,.45); text-align: center;
    opacity: 0; transform: translateY(18px) scale(.955);
    transition: opacity 280ms ease, transform 320ms cubic-bezier(.2,.8,.2,1);
}
.promo-modal-overlay.is-open .promo-modal-panel { opacity: 1; transform: translateY(0) scale(1); }
.promo-modal-overlay.is-closing { pointer-events: auto; }
.promo-modal-overlay.is-closing .promo-modal-panel { pointer-events: none; }
.promo-modal-panel * { box-sizing: border-box; }
.promo-modal-close { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; place-items: center; width: 39px; height: 39px; border: 0; border-radius: 50%; background: rgba(0,0,0,.78); color: #fff; cursor: pointer; font-family: Arial,sans-serif !important; font-size: 30px; line-height: 1; }
.promo-modal-close:hover { background: #111; }
/* A stable square canvas prevents lower-resolution or portrait photos from resizing the popup. */
.promo-modal-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--promo-bg, #fff); }
.promo-modal-image-link { position: absolute; inset: 0; display: block; z-index: 1; overflow: hidden; text-decoration: none; }
.promo-modal-image-link[href] { cursor: pointer; }
.promo-modal-image-link:not([href]) { pointer-events: none; cursor: default; }
.promo-modal-image-link:focus-visible { outline: 3px solid var(--promo-accent, #db2828); outline-offset: -4px; }
.promo-modal-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; background: transparent; }
.promo-modal-image--incoming { opacity: 0; z-index: 1; pointer-events: none; transition: opacity 420ms ease-in-out; }
.promo-modal-image--incoming.is-visible { opacity: 1; }
/* Captions fade with the image, without adding an empty area to image-only slides. */
.promo-modal-content { transition: opacity 200ms ease, transform 200ms ease; }
.promo-modal-content.is-switching { opacity: 0; transform: translateY(5px); }
.promo-modal-content { padding: 16px clamp(16px, 3vw, 30px) 12px; }
.promo-modal-title { margin: 0 0 8px; font-size: clamp(20px,3vw,29px); line-height: 1.22; color: var(--promo-fg, #191919); }
.promo-modal-description { margin: 0 auto 12px; max-width: 580px; font-size: clamp(13px,2vw,16px); line-height: 1.5; white-space: pre-line; color: var(--promo-fg, #191919); }
.promo-modal-action { display: inline-block; margin: 4px auto 0; padding: 12px 23px; border-radius: 10px; background: var(--promo-accent, #db2828); color: #fff !important; text-decoration: none; font-size: 14px; font-weight: 700; }
.promo-modal-action:hover { filter: brightness(.9); }
/* Simple white pagination dots, positioned over the image like the reference. */
.promo-modal-controls { position: absolute; left: 50%; bottom: 10px; z-index: 3; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 6px 8px; background: transparent; }
.promo-modal-controls[hidden], .promo-modal-title[hidden], .promo-modal-description[hidden], .promo-modal-action[hidden] { display: none !important; }
.promo-modal-dot { display: block; flex: 0 0 15px; width: 15px; height: 15px; margin: 0; padding: 0; border: 2px solid #fff; border-radius: 50%; background: rgba(236,236,236,.66); box-shadow: 0 1px 5px rgba(0,0,0,.48); cursor: pointer; appearance: none; -webkit-appearance: none; transition: background-color .15s ease, transform .15s ease; }
.promo-modal-dot:hover { background: #fff; }
.promo-modal-dot.is-active { background: #fff; transform: scale(1.08); }
.promo-modal-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.promo-modal-screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.promo-modal-preview-mark { display: block; padding: 8px 50px 8px 12px; background: #111; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.admin-promotion-slide-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; margin: 20px 0; }
.admin-promotion-slide { min-width: 0; padding: 16px; border: 1px solid #dedee2; border-radius: 10px; }
.admin-promotion-slide legend { padding: 0 7px; font-size: 14px; font-weight: 700; }
.admin-promotion-slide .field { min-width: 0; }
.admin-promotion-slide input[type="file"] { max-width: 100%; font-size: 12px; }
.admin-promotion-thumb { display: block; max-width: 170px; max-height: 110px; margin: 8px 0; border-radius: 8px; object-fit: contain; }
.admin-promotion-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 20px; }
@media (max-width: 780px) { .admin-promotion-slide-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .promo-modal-overlay { padding: 12px; } .promo-modal-panel { width: min(100%, calc(90dvh - 36px)); max-height: 92dvh; border-radius: 11px; } .promo-modal-content { padding: 14px; } .promo-modal-close { width: 36px; height: 36px; } .promo-modal-controls { bottom: 8px; gap: 7px; } .promo-modal-dot { flex-basis: 13px; width: 13px; height: 13px; } }
@media (prefers-reduced-motion: reduce) {
    .promo-modal-overlay, .promo-modal-overlay.is-open, .promo-modal-panel, .promo-modal-image--incoming, .promo-modal-content { transition: none !important; }
}

/* No empty caption section for image-only slides (even during transitions). */
.promo-modal-content[hidden] { display: none !important; padding: 0 !important; margin: 0 !important; }
/* The image needs no extra caption/panel spacing when title and description are absent. */
.promo-modal-panel.is-image-only .promo-modal-image { margin-bottom: 0; }

/* Promotion image manager: same add/reorder/remove/replace workflow as product gallery. */
.admin-promotion-uploadbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0; }
.admin-promo-choose-button { position: relative; display: inline-flex !important; align-items: center; gap: 5px; cursor: pointer; }
.admin-promo-choose-button > input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; pointer-events: none; }
.admin-promotion-dropzone { padding: 12px; min-height: 130px; border: 2px dashed #d8d9df; border-radius: 12px; transition: border-color .18s, background-color .18s; }
.admin-promotion-dropzone.is-drop-active { border-color: #db2828; background: #fff7f7; }
.admin-promotion-empty { min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #777; text-align: center; }
.admin-promotion-empty[hidden] { display: none !important; }
.admin-promotion-empty .icon { font-size: 24px; margin: 0; }
.admin-promotion-slide-grid { margin: 0; }
.admin-promotion-slide { background: #fff; transition: opacity .18s, box-shadow .18s; }
.admin-promotion-slide.is-dragging { opacity: .55; outline: 2px dashed #db2828; }
.admin-promotion-slide-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.admin-promotion-slide-controls { display: flex; align-items: center; gap: 5px; }
.admin-promotion-slide-controls .ui.button { margin: 0 !important; }
.admin-promotion-image-preview { position: relative; display: grid; place-items: center; width: 100%; min-height: 160px; margin-bottom: 10px; border-radius: 9px; background: #f5f5f7; border: 1px dashed #cdd0d6; overflow: hidden; text-align: center; }
.admin-promotion-image-preview > img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.admin-promotion-image-preview > img[hidden], .admin-promotion-image-preview > span[hidden] { display: none !important; }
.admin-promotion-image-preview > span { padding: 18px; font-size: 13px; color: #737780; }
.admin-promotion-image-preview > span .icon { display: block; font-size: 30px; margin: 0 auto 10px; }
.admin-promotion-image-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-promotion-image-actions .ui.button { margin: 0 !important; }
[data-promo-status] { min-height: 1.2em; margin: 8px 0; }
@media (max-width: 600px) {
    .admin-promotion-dropzone { padding: 6px; }
    .admin-promotion-slide { padding: 12px; }
    .admin-promotion-image-preview { min-height: 118px; }
}
