/*
 * Gift-draw campaign popup (Widgets/Campaign/giftPopup.html.twig, js/gift-popup.js).
 * Values follow the design "furbify – Mikulás & karácsonyi ajándék popup":
 * desktop = 740x560 dialog, mobile (< 768px) = bottom sheet. .xg-d = desktop only, .xg-m = mobile only.
 */
.xg[hidden], .xg-fab[hidden], .xg-err[hidden] { display: none !important; }

.xg { position: fixed; inset: 0; z-index: 2147483000; }
.xg *, .xg *::before, .xg *::after { box-sizing: border-box; }
.xg-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }

.xg-dialog {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 740px; height: 560px; max-height: calc(100vh - 32px);
    overflow-x: hidden; overflow-y: auto;
    font-family: 'Open Sans', sans-serif; color: #1D384C; background: #FFFFFF; text-align: left;
    border-radius: 8px; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    font-size: 14px; line-height: 1.4; letter-spacing: normal;
}
.xg-dialog:focus { outline: none; }
.xg-dialog p, .xg-dialog h2 { margin: 0; }
.xg-dialog a { color: #1D384C; text-decoration: underline; }
.xg-dialog a:hover { color: #4E7D0E; }
.xg-dialog button { font-family: inherit; color: #1D384C; text-transform: none; letter-spacing: normal; box-shadow: none; }
.xg-dialog svg { flex: 0 0 auto; overflow: visible; }

.xg-m { display: none !important; }

.xg-garland { position: absolute; left: 0; top: 0; }

.xg-x {
    position: absolute; right: 10px; top: 34px; z-index: 1; width: 44px; height: 44px; border-radius: 22px;
    border: none; background: #F7F7F7; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.xg-x:hover { background: #EEF2F5; }

.xg-step { display: none; }
.xg-dialog[data-step="valasztas"] .xg-s1,
.xg-dialog[data-step="email"] .xg-s2,
.xg-dialog[data-step="kupon"] .xg-s3,
.xg-dialog[data-step="mar-igenyelt"] .xg-s4 { display: flex; }

/* shared pieces */
.xg-kicker { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #C93838; }
.xg-h { font-size: 26px; line-height: 1.2; font-weight: 700; color: #1D384C; }
.xg-sub { font-size: 15px; line-height: 1.5; color: #4A6275; }
.xg-pill {
    display: inline-flex; align-items: center; gap: 8px; background: #F3F9EA; border: 1px solid #73AF1C;
    border-radius: 999px; font-size: 14px; color: #1D384C;
}
.xg-art { width: 100%; border-radius: 6px; background: #F5F7F8; display: flex; align-items: center; justify-content: center; }
.xg-c { fill: var(--xg-color, #73AF1C); }
.xg-r { fill: var(--xg-ribbon, #E45050); }

.xg-btn-or {
    border: none; border-radius: 6px; background: #FA8C05; color: #1D384C; font-family: inherit; font-weight: 700; cursor: pointer;
}
.xg-btn-or:hover { background: #FFA22E; }
.xg-btn-or:disabled { cursor: progress; opacity: .7; }
.xg-btn-sec {
    border: none; border-radius: 6px; background: #FFF4E6; color: #1D384C; font-family: inherit; font-weight: 700; cursor: pointer;
}
.xg-btn-sec:hover { background: #FFE7C7; }
.xg-lnk { background: none; border: none; padding: 0; font-family: inherit; font-size: 13px; font-weight: 600; color: #1D384C; cursor: pointer; }
.xg-lnk:hover { text-decoration: underline; }
.xg-pick:focus-visible, .xg-btn-or:focus-visible, .xg-btn-sec:focus-visible, .xg-x:focus-visible, .xg-lnk:focus-visible {
    outline: 3px solid #08B7E4; outline-offset: 2px;
}

/* 1 · Ajándék választása */
.xg-s1 { flex: 1; flex-direction: column; padding: 42px 32px 16px 32px; gap: 14px; }
.xg-s1 .xg-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 40px; }
.xg-pill-sure { margin-top: 4px; padding: 6px 14px; font-weight: 700; }
.xg-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.xg-tile {
    background: #FFFFFF; border-radius: 8px; box-shadow: 0 1px 6px rgba(0, 0, 0, .1); padding: 10px 10px 12px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 10px; transition: box-shadow .15s ease, transform .15s ease;
}
.xg-tile:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .16); transform: translateY(-3px); }
.xg-tile .xg-art { height: 160px; }
.xg-tile-lbl { font-size: 18px; font-weight: 700; }
.xg-pick { width: 100%; min-height: 44px; font-size: 14px; }
.xg-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.xg-fine { font-size: 12px; color: #5B7080; line-height: 1.45; }
.xg-foot .xg-lnk { min-height: 44px; white-space: nowrap; }

/* 2 · E-mail cím */
.xg-s2 { flex: 1; flex-direction: column; padding: 46px 40px 20px 40px; gap: 20px; margin: 0; }
.xg-s2 .xg-head { display: flex; flex-direction: column; gap: 6px; padding-right: 40px; }
.xg-row { display: flex; gap: 28px; align-items: flex-start; }
.xg-chosen {
    flex: 0 0 200px; position: relative; background: #FFFFFF; border-radius: 8px; box-shadow: 0 1px 6px rgba(0, 0, 0, .1);
    padding: 10px 10px 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.xg-chosen .xg-art { height: 130px; }
.xg-chosen-txt { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.xg-chosen-lbl { font-size: 12px; font-weight: 700; color: #4E7D0E; }
.xg-chosen-box { font-size: 16px; font-weight: 700; }
.xg-form { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xg-lbl { display: block; margin: 0; font-size: 14px; font-weight: 700; color: #1D384C; }
.xg-input {
    width: 100%; min-height: 48px; margin: 0; border: 1px solid #1D384C; border-radius: 6px; padding: 0 14px;
    font-family: inherit; font-size: 15px; color: #1D384C; background: #FFFFFF; box-shadow: none; outline-offset: 0;
}
.xg-input.is-invalid { border-color: #C93838; }
.xg-err { font-size: 13px; font-weight: 600; color: #C93838; }
.xg-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 13px; line-height: 1.4; font-weight: 400; color: #1D384C; cursor: pointer; }
.xg-check input { width: 18px; height: 18px; accent-color: #73AF1C; margin: 0; flex: 0 0 auto; appearance: auto; -webkit-appearance: checkbox; position: static; opacity: 1; }
.xg-check-news { color: #4A6275; }
.xg-submit { margin-top: 4px; min-height: 48px; font-size: 15px; }
.xg-note { font-size: 12px; line-height: 1.45; color: #5B7080; }
.xg-back { align-self: flex-start; margin-top: auto; min-height: 40px; }

/* 3 · Kupon */
.xg-s3 { flex: 1; flex-direction: column; align-items: center; padding: 36px 56px 18px 56px; gap: 12px; text-align: center; }
.xg-top { display: flex; align-items: center; gap: 18px; text-align: left; }
.xg-top .xg-art { flex: 0 0 auto; width: 104px; height: 96px; border-radius: 8px; }
.xg-top-txt { display: flex; flex-direction: column; gap: 2px; }
.xg-title3 { font-size: 14px; font-weight: 700; color: #4E7D0E; }
.xg-label { font-size: 30px; font-weight: 800; line-height: 1.15; }
.xg-desc { font-size: 14px; color: #4A6275; }
.xg-pill-bonus { margin-top: 6px; align-self: flex-start; padding: 5px 12px; }
.xg-pill b { font-weight: 700; }
.xg-ico > g { display: none; }
.xg-dialog[data-gift="kedvezmeny"] .xg-ico-kedvezmeny,
.xg-dialog[data-gift="szallitas"] .xg-ico-szallitas,
.xg-dialog[data-gift="billentyuzet"] .xg-ico-billentyuzet { display: inline; }
.xg-codebox {
    width: 100%; border: 2px dashed #73AF1C; border-radius: 8px; padding: 8px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.xg-codecol { display: flex; flex-direction: column; align-items: flex-start; }
.xg-codelbl { font-size: 11px; font-weight: 700; color: #4A6275; text-transform: uppercase; letter-spacing: .06em; }
.xg-code { font-size: 28px; font-weight: 800; letter-spacing: .1em; line-height: 1.4; }
.xg-copy { min-height: 48px; padding: 0 22px; font-size: 15px; white-space: nowrap; }
.xg-valid { width: 100%; display: flex; align-items: center; gap: 12px; background: #FFF4E6; border-radius: 8px; padding: 8px 16px; text-align: left; }
.xg-valid-txt { display: flex; flex-direction: column; gap: 1px; }
.xg-valid-main { font-size: 15px; font-weight: 700; }
.xg-valid-short { font-size: 13px; color: #4A6275; }
.xg-rule { font-size: 13px; line-height: 1.5; color: #4A6275; }
.xg-rule b { color: #1D384C; font-weight: 700; }
.xg-shop { margin-top: auto; min-height: 48px; padding: 0 28px; font-size: 15px; }

/* 4 · Már igényelt */
.xg-s4 { flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 46px 72px 32px 72px; gap: 14px; text-align: center; }
.xg-dup-ico { width: 60px; height: 60px; border-radius: 30px; background: #FFF4E6; display: flex; align-items: center; justify-content: center; }
.xg-h4 { font-size: 24px; line-height: 1.25; font-weight: 700; color: #1D384C; }
.xg-dup { font-size: 15px; line-height: 1.55; color: #4A6275; }
.xg-codebox-dup { padding: 10px 16px; text-align: left; }
.xg-dup-gift { font-size: 13px; font-weight: 700; color: #4E7D0E; }
.xg-codebox-dup .xg-code { font-size: 26px; }
.xg-s4 .xg-shop { margin-top: 6px; }

/* Already used on an order: data-used on .xg-dialog swaps the wording, the code is shown struck through without copy */
.xg-dialog .xg-used { display: none; }
.xg-dialog[data-used="1"] .xg-unused { display: none; }
.xg-dialog[data-used="1"] .xg-used { display: inline; }
.xg-dialog[data-used="1"] .xg-codebox-dup { border-color: #8A9AA6; }
.xg-dialog[data-used="1"] .xg-codebox-dup .xg-code { color: #5B7080; text-decoration: line-through; }
.xg-used-badge {
    border-radius: 999px; background: #EEF2F5; color: #4A6275; padding: 6px 14px; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.xg-dialog[data-used="1"] .xg-used-badge { display: inline-block; }

/* Floating gift button: brings the popup (and the claimed code) back */
.xg-fab {
    position: fixed; right: 16px; bottom: 96px; z-index: 2147482999; width: 56px; height: 56px; border-radius: 28px;
    border: none; padding: 0; background: #FA8C05; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.xg-fab:hover { background: #FFA22E; }
.xg-fab:focus-visible { outline: 3px solid #08B7E4; outline-offset: 2px; }

html.xg-open, html.xg-open body { overflow: hidden; }

/* Mobile: bottom sheet */
@media (max-width: 767.98px) {
    .xg-d { display: none !important; }
    .xg-m { display: revert !important; }
    span.xg-m { display: inline !important; }
    svg.xg-m, .xg-garland.xg-m { display: block !important; }
    .xg-btn-or.xg-m { display: block !important; }
    p.xg-m { display: block !important; }

    .xg-dialog {
        left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; height: auto; max-height: 100%;
        border-radius: 16px 16px 0 0; box-shadow: none;
    }
    .xg-garland.xg-m { position: static; width: 100%; height: auto; }
    .xg-x { right: 8px; top: 28px; }
    .xg-x svg { width: 14px; height: 14px; }

    .xg-kicker { font-size: 12px; }
    .xg-h { font-size: 21px; line-height: 1.25; }
    .xg-sub { font-size: 13.5px; line-height: 1.45; }

    .xg-s1 { flex: 0 0 auto; padding: 0 16px 22px 16px; gap: 14px; }
    .xg-s1 .xg-head, .xg-s2 .xg-head { align-items: stretch; gap: 4px; text-align: left; padding: 0 44px 0 0; }
    .xg-pill-sure { align-self: flex-start; padding: 6px 12px; font-size: 13px; }
    .xg-pill svg { width: 15px; height: 15px; }
    .xg-tiles { gap: 10px; }
    .xg-tile { box-shadow: 0 1px 6px rgba(0, 0, 0, .12); padding: 6px 6px 8px 6px; gap: 6px; }
    .xg-tile:hover { box-shadow: 0 1px 6px rgba(0, 0, 0, .12); transform: none; }
    .xg-tile .xg-art { height: 92px; }
    .xg-tile .xg-art svg { width: 76px; height: 76px; }
    .xg-tile-lbl { font-size: 15px; }
    .xg-pick { font-size: 13px; }
    .xg-pick:active { background: #FFA22E; }
    .xg-foot { margin-top: 0; justify-content: center; }
    .xg-fine { font-size: 11.5px; text-align: center; }

    .xg-s2 { flex: 0 0 auto; padding: 0 16px 22px 16px; gap: 12px; }
    .xg-row, .xg-form { display: contents; }
    .xg-chosen {
        flex: 0 0 auto; flex-direction: row; align-items: center; gap: 12px; box-shadow: 0 1px 6px rgba(0, 0, 0, .12); padding: 8px;
    }
    .xg-chosen .xg-art { flex: 0 0 56px; width: 56px; height: 56px; }
    .xg-chosen .xg-art svg { width: 44px; height: 44px; }
    .xg-chosen-txt { align-items: flex-start; gap: 0; }
    .xg-input { font-size: 16px; }
    .xg-check input { width: 20px; height: 20px; }
    .xg-submit { margin-top: 0; min-height: 50px; font-size: 16px; }
    .xg-note { text-align: center; }
    .xg-back { align-self: stretch; margin-top: 0; }
    .xg-back:hover { text-decoration: none; }

    .xg-s3 { flex: 0 0 auto; padding: 0 16px 24px 16px; gap: 12px; }
    .xg-top { flex-direction: column; gap: 12px; text-align: center; }
    .xg-top .xg-art { width: 96px; height: 88px; }
    .xg-top .xg-art svg { width: 84px; height: 84px; }
    .xg-ico { stroke-width: 2.2; }
    .xg-top-txt { display: contents; }
    .xg-label { font-size: 26px; }
    .xg-desc { margin-top: -6px; font-size: 13px; }
    .xg-pill-bonus { margin-top: 0; align-self: center; padding: 6px 12px; font-size: 13px; }
    .xg-s3 .xg-codebox { flex-direction: column; padding: 10px 14px; gap: 0; }
    .xg-s3 .xg-codecol { align-items: center; }
    .xg-s3 .xg-code { font-size: 26px; }
    .xg-copy-m { width: 100%; min-height: 50px; font-size: 16px; }
    .xg-valid { gap: 10px; padding: 10px 14px; }
    .xg-valid svg { width: 22px; height: 22px; }
    .xg-valid-txt { gap: 0; }
    .xg-valid-main { font-size: 14px; }
    .xg-valid-short { font-size: 12.5px; }
    .xg-rule { font-size: 12.5px; }
    .xg-shop { width: 100%; margin-top: 0; min-height: 50px; font-size: 16px; }

    .xg-s4 { flex: 0 0 auto; padding: 0 16px 24px 16px; gap: 12px; }
    .xg-h4 { font-size: 21px; }
    .xg-dup { font-size: 13.5px; line-height: 1.45; }
    .xg-codebox-dup { flex-wrap: wrap; }
    .xg-s4 .xg-shop { margin-top: 0; }

    .xg-fab { bottom: 88px; }
}
