/**
 * Welcome discount popup.
 * Layouts: .wd-popup--overlay (text over the image), .wd-popup--below (text under the image).
 *
 * @package brava.bg
 */
.wd-popup {
    --wd-accent: #ff7b0a;
    --wd-accent-dark: #e86a00;
    --wd-ink: #221f1f;
    --wd-muted: #686868;
    --wd-line: #e4e4e4;
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: 'OpenSans', Arial, sans-serif;
    opacity: 0;
    transition: opacity .25s ease;
}
.wd-popup[hidden] { display: none; }
.wd-popup *,
.wd-popup *::before,
.wd-popup *::after { box-sizing: border-box; }
.wd-popup.is-open { opacity: 1; }
html.wd-popup-lock { overflow: hidden; }

.wd-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(34, 31, 31, .6);
}

.wd-popup__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    transform: translateY(16px) scale(.98);
    transition: transform .25s ease;
}
.wd-popup.is-open .wd-popup__dialog { transform: none; }

.wd-popup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--wd-ink);
    font-size: 26px;
    line-height: 36px;
    cursor: pointer;
}
.wd-popup__close:hover { background: #fff; color: var(--wd-accent); }

.wd-popup__media { display: block; }
.wd-popup__media img {
    display: block;
    width: 100%;
    height: auto;
}

.wd-popup__content {
    padding: 24px 28px 28px;
    text-align: center;
    color: var(--wd-ink);
}

.wd-popup__step[hidden] { display: none; }

.wd-popup__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}
.wd-popup__text {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--wd-muted);
}

.wd-popup__button {
    display: inline-block;
    min-width: 200px;
    height: 48px;
    padding: 0 28px;
    border: 0;
    border-radius: 4px;
    background: var(--wd-accent);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease;
}
.wd-popup__button:hover,
.wd-popup__button:focus { background: var(--wd-accent-dark); }
.wd-popup__button:disabled { opacity: .7; cursor: wait; }
.wd-popup__button.is-copied { background: #449684; }

.wd-popup__error {
    margin-top: 12px;
    font-size: 14px;
    color: #e7352b;
}
.wd-popup__error:empty { display: none; }

.wd-popup__code {
    display: flex;
    max-width: 400px;
    margin: 16px auto 12px;
}
.wd-popup__code-input {
    /* width:0 + basis 0: an <input> otherwise keeps its intrinsic ~20ch width in a flex row
       on mobile browsers (Safari) and pushes the copy button out of the dialog */
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 12px;
    border: 2px dashed var(--wd-accent);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    background: #fff;
    color: var(--wd-ink);
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
}
.wd-popup__code .wd-popup__button {
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
    border-radius: 0 4px 4px 0;
}
.wd-popup__note {
    font-size: 14px;
    line-height: 1.4;
    color: var(--wd-muted);
}

/* --- Overlay: text over the image ------------------------------------- */
.wd-popup--overlay .wd-popup__dialog { max-width: 640px; }
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__dialog { display: grid; }
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__media,
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__content { grid-area: 1 / 1; }
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__media img {
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__content {
    position: relative;
    z-index: 2;
    align-self: end;
    padding-top: 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .45) 60%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
}
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__title { font-size: 34px; text-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__text,
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__note { color: rgba(255, 255, 255, .9); }
.wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__error { color: #ffb3ae; }

/* --- Phones ------------------------------------------------------------ */
@media (max-width: 599px) {
    .wd-popup { padding: 12px; }
    .wd-popup__content { padding: 20px 16px 20px; }
    .wd-popup__title,
    .wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__title { font-size: 24px; }
    .wd-popup__text { font-size: 15px; margin-bottom: 16px; }
    .wd-popup__button { width: 100%; min-width: 0; }
    .wd-popup__code .wd-popup__button { width: auto; padding: 0 14px; font-size: 14px; }
    .wd-popup__code-input { padding: 0 6px; font-size: 16px; letter-spacing: 1px; }
    .wd-popup--overlay:not(.wd-popup--noimage) .wd-popup__media img { min-height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
    .wd-popup,
    .wd-popup__dialog { transition: none; }
}
