/* Gutschein-Shop hotel-oasis.at – sits inside the TYPO3 theme (Bootstrap 4 grid, fonts "Big Shoulders"/"Playfair") */

@font-face {
    font-family: "Voucher Headline";
    src: url(../fonts/BigShouldersText-Bold.ttf);
    font-display: swap;
}

@font-face {
    font-family: "Voucher Text";
    src: url(../fonts/PlayfairDisplay-Regular.ttf);
    font-display: swap;
}

.voucher-shop {
    --green: #55ac26;
    --green-dark: #007f31;
    --text: #3c3c3c;
    --muted: #6c757d;
    --line: #dcdcdc;
    --error: #b3261e;
    padding: 110px 0 80px;
    color: var(--text);
}

.voucher-shop .container {
    max-width: 1140px;
}

.voucher-shop h1 {
    font-family: "Playfair", serif;
    color: var(--green);
    text-align: center;
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.voucher-shop .intro {
    max-width: 760px;
    margin: 0 auto 2rem;
    text-align: center;
}

.voucher-shop .intro .lead {
    font-family: "Playfair", serif;
    font-size: 1.35rem;
}

.voucher-shop h2,
.voucher-shop .step {
    font-family: "Big Shoulders", sans-serif;
    text-transform: uppercase;
    color: var(--green);
    font-size: 1.4rem;
    letter-spacing: 0.02em;
    margin: 1.75rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.voucher-shop h2::after,
.voucher-shop .step::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--green);
}

/* Switch between Wertgutschein and Pauschale */
.shop-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 2rem;
    flex-wrap: wrap;
}

.shop-tabs a {
    font-family: "Big Shoulders", sans-serif;
    text-transform: uppercase;
    font-size: 1.1rem;
    padding: 0.55rem 1.4rem;
    border: 1px solid var(--green);
    color: var(--green);
    text-decoration: none;
}

.shop-tabs a.active,
.shop-tabs a:hover {
    background: var(--green);
    color: #fff;
}

.cart-link {
    position: fixed;
    right: 0;
    top: 160px;
    z-index: 900;
    background: var(--green-dark);
    color: #fff !important;
    font-family: "Big Shoulders", sans-serif;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    text-decoration: none !important;
}

/* Motif picker */
.motifs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 0;
    border: 0;
}

.motifs label {
    margin: 0;
    cursor: pointer;
    position: relative;
    text-align: center;
    font-size: 0.85rem;
}

.motifs input {
    position: absolute;
    opacity: 0;
}

.motifs img {
    width: 100%;
    display: block;
    border: 3px solid transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: border-color 0.15s;
}

.motifs input:checked + img {
    border-color: var(--green);
}

.motifs input:focus-visible + img {
    outline: 2px solid var(--green-dark);
    outline-offset: 2px;
}

/* Form */
.voucher-shop label.field {
    display: block;
    margin: 0 0 1rem;
    font-weight: normal;
}

.voucher-shop label.field > span {
    display: block;
    font-family: "Big Shoulders", sans-serif;
    text-transform: uppercase;
    color: var(--green);
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.voucher-shop input[type=text],
.voucher-shop input[type=email],
.voucher-shop input[type=tel],
.voucher-shop input[type=number],
.voucher-shop input[type=password],
.voucher-shop select,
.voucher-shop textarea {
    width: 100%;
    border: 1px solid #b5b5b5;
    padding: 0.5rem 0.6rem;
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    border-radius: 0;
}

.voucher-shop input:focus,
.voucher-shop select:focus,
.voucher-shop textarea:focus {
    outline: 2px solid var(--green);
    outline-offset: 0;
    border-color: var(--green);
}

.voucher-shop .hint {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.voucher-shop .field-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.voucher-shop .has-error input,
.voucher-shop .has-error select {
    border-color: var(--error);
}

.voucher-shop .check {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin: 0.5rem 0 1rem;
    font-weight: normal;
}

.voucher-shop .check input {
    margin-top: 0.3rem;
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--green);
}

.shop-button {
    display: inline-block;
    background: var(--green);
    color: #fff !important;
    border: 1px solid var(--green);
    font-family: "Big Shoulders", sans-serif;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 0.03em;
    padding: 0.65rem 2rem;
    cursor: pointer;
    text-decoration: none !important;
}

.shop-button:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

.shop-button.secondary {
    background: transparent;
    color: var(--green) !important;
}

.shop-button.secondary:hover {
    background: var(--green);
    color: #fff !important;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}

.price-line {
    font-family: "Big Shoulders", sans-serif;
    font-size: 1.8rem;
    color: var(--green-dark);
    margin: 0.5rem 0 1rem;
}

.flash {
    padding: 0.8rem 1rem;
    margin: 0 0 1.5rem;
    border-left: 4px solid var(--error);
    background: #fdecea;
}

.flash.success {
    border-color: var(--green);
    background: #eef7e8;
}

/* Live preview – positions mirror src/VoucherPdf.php (A4 = 210 × 297 mm) */
.voucher-preview {
    position: sticky;
    top: 100px;
    container-type: inline-size;
    aspect-ratio: 210 / 297;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    background: #fff;
    overflow: hidden;
    margin-bottom: 1rem;
}

.voucher-preview > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.voucher-preview .vp {
    position: absolute;
    line-height: 1.25;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* 1 pt = 0.1680 cqw on a 210 mm wide page */
.vp-center { left: 70.48%; width: 24.76%; text-align: center; color: #fff; }
.vp-label { font-family: "Voucher Text", serif; }
.vp-amount { font-family: "Voucher Headline", sans-serif; }
.value-mode .vp-label { top: 42.09%; font-size: 4.37cqw; }
.value-mode .vp-amount { top: 46.46%; font-size: 7.39cqw; }
.vp-pauschale, .vp-heading, .vp-rule { display: none; }
.package-mode .vp-pauschale { display: block; top: 40.40%; font-size: 3.36cqw; font-family: "Voucher Text", serif; }
.package-mode .vp-heading {
    display: flex; align-items: center; justify-content: center;
    left: 68.10%; width: 28.57%; top: 43.77%; height: 8.42%;
    font-family: "Voucher Headline", sans-serif; font-size: 3.70cqw; line-height: 1.1;
}
.package-mode .vp-rule { display: block; left: 76.19%; width: 14.29%; top: 52.53%; border-top: 0.24cqw solid #fff; }
.package-mode .vp-label { top: 53.20%; font-size: 2.52cqw; }
.package-mode .vp-amount { top: 55.89%; font-size: 2.69cqw; }
.vp-title { left: 4.76%; width: 61.90%; top: 65.66%; font-family: "Voucher Headline", sans-serif; font-size: 3.02cqw; color: var(--green-dark); }
.vp-message { left: 4.76%; width: 61.90%; top: 69.02%; font-family: "Voucher Text", serif; font-size: 1.85cqw; color: #434443; }
.vp-meta { left: 70.95%; width: 27%; top: 75.76%; font-family: Arial, sans-serif; font-size: 1.68cqw; color: #434443; }

.preview-note {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Cart */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.cart-table th,
.cart-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 0.5rem;
    vertical-align: top;
    text-align: left;
}

.cart-table th {
    font-family: "Big Shoulders", sans-serif;
    text-transform: uppercase;
    color: var(--green);
    font-weight: normal;
}

.cart-table .num {
    text-align: right;
    white-space: nowrap;
}

.cart-table input[type=number] {
    width: 4.5rem;
}

.cart-table .thumb {
    width: 64px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cart-table .details {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.cart-table tfoot td {
    font-family: "Big Shoulders", sans-serif;
    font-size: 1.4rem;
    border-bottom: 0;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
}

.payment-box {
    background: #f4f8f1;
    border-left: 4px solid var(--green);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.payment-box dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0 0;
}

.payment-box dd {
    margin: 0;
}

.info-list li {
    margin-bottom: 0.4rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .voucher-shop {
        padding-top: 90px;
    }

    .voucher-shop h1 {
        font-size: 1.8rem;
    }

    .voucher-preview {
        position: relative;
        top: 0;
        max-width: 420px;
        margin: 0 auto 1.5rem;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        display: grid;
        grid-template-columns: 64px 1fr;
        gap: 0.25rem 0.75rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--line);
    }

    .cart-table td {
        border: 0;
        padding: 0;
    }

    .cart-table td.thumb-cell {
        grid-row: span 3;
    }

    .cart-table .num {
        text-align: left;
    }

    .cart-table tfoot tr {
        display: flex;
        justify-content: space-between;
    }

    .cart-link {
        top: auto;
        bottom: 0;
    }
}
