/* Shared storefront popup skin. Visibility, submission and widget sizing stay
   under the existing scripts and component-specific rules. */
:root {
    --popup-paper: #f4eee9;
    --popup-gold: #cca468;
    --popup-ink: #302f2d;
    --popup-border: #deccb0;
    --popup-overlay: rgba(48, 47, 45, .48);
}

body .jquery-modal.blocker {
    padding: 16px;
    background: var(--popup-overlay);
}

/* The review badge uses the maximum z-index; keep it behind open dialogs. */
body:has(.jquery-modal.blocker, .product-review-dialog[open], .swal2-container, #s-cnt[aria-hidden="false"], #cm[aria-hidden="false"]) > [id^="hw-"] {
    visibility: hidden;
}

body .modal {
    box-sizing: border-box;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 32px 28px 28px;
    border: 1px solid var(--popup-border);
    border-radius: 16px;
    background: var(--popup-paper);
    color: var(--popup-ink);
    box-shadow: none;
    font-family: var(--font, "Plus Jakarta Sans", sans-serif);
    font-size: 15px;
    line-height: 1.6;
}

body .modal > :is(h2, h3, .modal-title),
body .modal > div:first-child > h3,
body .modal > .modal__content > .h2,
body #hodnoceni_modal h3 {
    margin: 0 44px 20px 0;
    color: var(--popup-ink);
    font-family: "Bellota", sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

body .modal > p {
    line-height: 1.6;
}

body .modal a.close-modal,
body .product-review-dialog__header button {
    box-sizing: border-box;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--popup-border);
    border-radius: 50%;
    background: var(--popup-paper);
    color: var(--popup-ink);
    text-indent: 0;
    text-decoration: none;
    font-size: 0;
}

body .modal a.close-modal::before,
body .modal a.close-modal::after,
body .product-review-dialog__header button::before,
body .product-review-dialog__header button::after {
    position: absolute;
    top: 20px;
    left: 13px;
    width: 16px;
    height: 2px;
    background: var(--popup-ink);
    transform: rotate(45deg);
    content: "";
}

body .modal a.close-modal::after,
body .product-review-dialog__header button::after {
    transform: rotate(-45deg);
}

body .modal a.close-modal:hover,
body .product-review-dialog__header button:hover {
    background: var(--popup-gold);
}

body .modal :is(a, button, input, textarea, select):focus-visible,
body .product-review-dialog button:focus-visible {
    outline: 2px solid var(--popup-ink);
    outline-offset: 3px;
}

body .modal.login-window :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], textarea),
body #hodnoceni_modal :is(input[type="text"], input[type="email"], textarea) {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--popup-border);
    border-radius: 8px;
    background: #fff;
    color: var(--popup-ink);
    font: inherit;
    line-height: 1.5;
}

body .modal.login-window textarea,
body #hodnoceni_modal textarea {
    min-height: 120px;
    resize: vertical;
}

body #hodnoceni_modal h4 {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-color: var(--popup-border);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

body .modal :is(.link a, .link input[type="submit"], button[type="submit"], .btn-yellow),
body #hodnoceni_modal .link input {
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid #c42b4e;
    border-radius: 8px;
    background: #c42b4e;
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-transform: none;
}

body .modal .btn-gray {
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid var(--popup-border);
    border-radius: 8px;
    background: var(--popup-paper);
    color: var(--popup-ink);
    font: inherit;
}

body .modal .link a[rel="modal:close"] {
    border-color: var(--popup-border);
    background: transparent;
    color: var(--popup-ink);
}

/* Preserve the wide cart panels and map/document canvases. */
body :is(#add_to_cart_modal_system, #add_to_cart_modal_system_2, #add_to_cart_modal_system_darek) {
    width: calc(100% - 16px);
    padding: 32px 28px 28px;
}

body :is(#leaflet_map_modal, #post_services, #posta_search, #DPD_services, #pdf_view) {
    padding-top: 64px;
}

body #DPD_services {
    border-radius: 16px !important;
}

body .product-review-dialog {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 32px 28px 28px;
    border: 1px solid var(--popup-border);
    border-radius: 16px;
    background: var(--popup-paper);
    color: var(--popup-ink);
    box-shadow: none;
}

body .product-review-dialog::backdrop {
    background: var(--popup-overlay);
}

body .product-review-dialog__header {
    margin: 0 44px 20px 0;
}

body .product-review-dialog__header h2 {
    font-family: "Bellota", sans-serif;
    font-size: 26px;
    line-height: 1.25;
}

body .product-review-dialog__content.review-card {
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
}

body .product-review-dialog__content .review-card__text {
    font-size: inherit;
    line-height: inherit;
}

/* The fixed 304px Google widget otherwise overflows a 320px form. */
@media (max-width: 359px) {
    body .modal .g-recaptcha {
        zoom: .8;
    }
}

/* Cookie Consent: skin both the initial notice and preference panel without
   changing button order, consent choices, toggles or vendor content. */
body .cc_div {
    --cc-bg: var(--popup-paper);
    --cc-text: var(--popup-ink);
    --cc-btn-primary-bg: #c42b4e;
    --cc-btn-primary-text: #fff;
    --cc-btn-primary-hover-bg: #a92241;
    --cc-btn-secondary-bg: var(--popup-paper);
    --cc-btn-secondary-text: var(--popup-ink);
    --cc-btn-secondary-hover-bg: #e9ddcd;
    --cc-section-border: var(--popup-border);
    --cc-cookie-category-block-bg: #fff;
    --cc-cookie-category-block-bg-hover: #eee4d6;
    --cc-toggle-bg-on: var(--popup-gold);
    --cc-overlay-bg: var(--popup-overlay);
    font-family: var(--font, "Plus Jakarta Sans", sans-serif);
}

body .cc_div :is(#cm, #s-inr) {
    border: 1px solid var(--popup-border);
    border-radius: 16px;
    background: var(--popup-paper);
    box-shadow: none;
}

body .cc_div :is(#c-ttl, #s-ttl) {
    padding-right: 44px;
    color: var(--popup-ink);
    font-family: "Bellota", sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

body .cc_div :is(#c-txt, #s-bl .p) {
    color: var(--popup-ink);
    font-size: 14px;
    line-height: 1.6;
}

body .cc_div .c-bn {
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid var(--popup-border);
    border-radius: 8px;
    background: var(--popup-paper);
    color: var(--popup-ink);
    font-size: 14px;
    line-height: 1.4;
}

body .cc_div :is(#c-bns, #s-bns) button:first-child {
    border-color: #c42b4e;
    background: #c42b4e;
    color: #fff;
}

body .cc_div #s-inr {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
}

body .cc_div #s-hdr {
    position: relative;
    flex: 0 0 auto;
}

body .cc_div #s-bl {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    margin: 0;
    overflow-y: auto;
}

body .cc_div #s-bns {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    padding: 16px 20px;
}

body .cc_div #s-bns button {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin: 0 !important;
    float: none;
    white-space: normal;
}

body .cc_div .c-bn:focus-visible {
    outline: 2px solid var(--popup-ink);
    outline-offset: 3px;
}

body .cc_div :is(#c-close, #s-c-bn) {
    width: 44px;
    height: 44px;
    border: 1px solid var(--popup-border);
    border-radius: 50%;
    background: var(--popup-paper);
}

body .cc_div :is(#c-close, #s-c-bn)::before,
body .cc_div :is(#c-close, #s-c-bn)::after {
    background: var(--popup-ink);
}

/* SweetAlert keeps its icons, labels, loading state and callbacks. */
body .swal2-container.swal2-backdrop-show {
    background: var(--popup-overlay);
}

body .swal2-popup {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid var(--popup-border);
    border-radius: 16px;
    background: var(--popup-paper);
    color: var(--popup-ink);
    box-shadow: none;
    font-family: var(--font, "Plus Jakarta Sans", sans-serif);
}

body .swal2-title {
    color: var(--popup-ink);
    font-family: "Bellota", sans-serif;
    font-size: 26px;
    line-height: 1.3;
}

body :is(.swal2-content, .swal2-html-container) {
    color: var(--popup-ink);
    font-size: 15px;
    line-height: 1.6;
}

body .swal2-actions {
    gap: 8px;
}

body .swal2-styled:is(.swal2-confirm, .swal2-cancel, .swal2-deny) {
    min-height: 44px;
    margin: 0;
    padding: 11px 20px;
    border: 1px solid var(--popup-border);
    border-radius: 8px;
    background: var(--popup-paper);
    color: var(--popup-ink);
    font-size: 15px;
    text-transform: none;
    box-shadow: none;
}

body .swal2-styled.swal2-confirm {
    border-color: #c42b4e;
    background: #c42b4e;
    color: #fff;
}

body .swal2-close {
    width: 44px;
    height: 44px;
    margin: 10px;
    border: 1px solid var(--popup-border);
    border-radius: 50%;
    color: var(--popup-ink);
}

body .swal2-styled:focus-visible,
body .swal2-close:focus-visible {
    outline: 2px solid var(--popup-ink);
    outline-offset: 3px;
    box-shadow: none;
}

@media (max-width: 767px) {
    body .jquery-modal.blocker {
        padding: 12px;
    }

    body .modal,
    body .product-review-dialog,
    body .swal2-popup {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 24px 20px;
    }

    body .modal {
        width: 100%;
    }

    body :is(#add_to_cart_modal_system, #add_to_cart_modal_system_2, #add_to_cart_modal_system_darek) {
        box-sizing: border-box;
        width: 100%;
        max-width: 100% !important;
        padding: 24px 20px;
    }

    body .modal a.close-modal,
    body .product-review-dialog__header button {
        top: 8px;
        right: 8px;
    }

    body .modal > :is(h2, h3, .modal-title),
    body .modal > div:first-child > h3,
    body .modal > .modal__content > .h2,
    body #hodnoceni_modal h3,
    body .product-review-dialog__header h2,
    body .swal2-title {
        font-size: 24px;
    }

    body :is(#leaflet_map_modal, #post_services, #posta_search, #DPD_services, #pdf_view) {
        padding-top: 60px;
    }

    body .cc_div :is(#cm, #s-inr) {
        border-radius: 14px;
    }

    body .cc_div #s-inr {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    body .cc_div #s-bns {
        flex-direction: column;
    }

    body #zeptat_se_na_produkt_modal label + input {
        width: 100%;
        margin-left: 0;
    }

    body #zeptat_se_na_produkt_modal label:not(:has(input)) {
        display: block;
        margin-bottom: 6px;
    }
}
