/* ==========================================================================
   Efteling — Secure checkout
   Cream/red/brown palette, Alegreya typography, Adyen Drop-In-inspired layout.
   ========================================================================== */

:root {
    /* Brand palette — Beekse Bergen / Libéma Resorts (sniffed from www.swatch.nl /tickets) */
    --bg: #f5f2ec;                  /* cream — footer/section bg */
    --text: #232323;                /* body */
    --text-muted: #6f6a5e;          /* secondary */
    --card-bg: #ffffff;
    --card-bg-alt: #faf7ef;
    --hairline: #e0ddd3;
    --hairline-dark: #c8c4b8;
    --brand-red: #e85b14;           /* primary CTA orange (VOLGENDE on upstream) */
    --brand-red-darker: #c44a0c;
    --logo-gold: #f2c200;           /* amber — cart total bar */
    --warning: #d32f2f;
    --warning-bg: #fde7e9;
    --success: #4f5630;             /* olive */
    --focus-ring: rgba(232, 91, 20, 0.22);
    --olive: #4f5630;               /* primary olive — header background */
    --olive-darker: #3d4423;

    --serif: 'Alegreya', 'Iowan Old Style', 'Palatino', Georgia, serif;
    --sans: 'Alegreya Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --radius-card: 8px;
    --radius-field: 5px;
    --radius-btn: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.kk-app { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--brand-red); text-decoration: none; }
a:hover { color: var(--brand-red-darker); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.kk-checkout {
    flex: 1 1 auto;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.kk-card {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- Header (logo + helpline) — Beekse Bergen full-bleed olive bar ---------- */
.kk-header {
    background: var(--olive);
    width: 100%;
    border-bottom: none;
}
.kk-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
}
.kk-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.kk-logo img { width: 154px; height: auto; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.18)); }
.kk-helpline {
    margin: 0;
    font-family: var(--sans);
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    text-align: right;
    line-height: 1.4;
}
.kk-helpline a { color: #fff; font-weight: 600; }
.kk-helpline a:hover { color: var(--logo-gold); }

/* ---------- Headings ---------- */
.kk-heading {
    margin: 16px 0 4px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    font-size: 30px;
    line-height: 1.15;
    color: var(--brand-red);
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}
.kk-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 2px;
    background: var(--brand-red);
}
.kk-subheading {
    margin: 12px 0 12px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    font-size: 22px;
    line-height: 1.2;
    color: var(--brand-red);
}

/* ---------- Amount summary card ---------- */
.kk-amount {
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kk-amount__name {
    margin: 0;
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
}
.kk-amount__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.kk-amount__label {
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.kk-amount__price {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.kk-amount__breakdown {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kk-amount__line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.kk-amount__line--muted { color: var(--text-muted); }
.kk-amount__line--total { font-weight: 600; padding-top: 6px; border-top: 1px solid var(--hairline); margin-top: 4px; }

/* ---------- Payment method card ---------- */
.kk-method-card {
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.kk-method-card--open {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.kk-method-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.kk-method-card--open .kk-method-card__head { margin-bottom: 16px; }
.kk-method-card__dot {
    width: 16px;
    height: 16px;
    border: 2px solid var(--hairline-dark);
    border-radius: 50%;
    flex: none;
    position: relative;
    background: var(--card-bg);
}
.kk-method-card--open .kk-method-card__dot {
    border-color: var(--brand-red);
}
.kk-method-card--open .kk-method-card__dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--brand-red);
}
.kk-method-card__title {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    flex: 1;
}
.kk-method-card__icon {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--card-bg-alt);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 2px 6px;
}
.kk-method-card__icon--giftcard { font-size: 14px; }
.kk-method-card__icon--gpay { color: #1a73e8; }

.kk-method-card--disabled {
    opacity: 0.7;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- Form ---------- */
.kk-form { display: contents; }

.kk-required-note {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.kk-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.kk-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.kk-field-row .kk-field { margin-bottom: 0; }

.kk-label {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.kk-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--hairline-dark);
    border-radius: var(--radius-field);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.kk-input-wrap:focus-within {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.kk-input {
    flex: 1;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 12px 12px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    line-height: 1.2;
}
.kk-input::placeholder { color: var(--text-muted); opacity: 0.62; }
.kk-input--tabularnums, .CheckoutInput--tabularnums { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.kk-input-hint {
    margin: 4px 2px 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.kk-card-brand {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
.kk-card-brand img { height: 18px; }

.kk-card-brands {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.kk-card-brands img { height: 18px; width: auto; opacity: 0.92; }

.kk-billing-hidden { display: none !important; }

/* Error states (used by main.js via ui.setInputError) */
.kk-input-wrap.has-error,
.FormFieldInput.has-error .kk-input-wrap { border-color: var(--warning); background: var(--warning-bg); }
.FormFieldInput.has-error .kk-label { color: var(--warning); }

/* ---------- Button ---------- */
.kk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: var(--radius-btn);
    background: var(--brand-red);
    color: #ffffff;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease;
    margin-top: 8px;
}
.kk-btn:hover { background: var(--brand-red-darker); }
.kk-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.kk-btn--pay { letter-spacing: 0.02em; }
.kk-btn__lock { flex: none; }

.kk-btn .SubmitButton-Text--pre { display: none; }
.kk-btn.is-processing .SubmitButton-Text--current { display: none; }
.kk-btn.is-processing .SubmitButton-Text--pre { display: inline; }

/* ---------- Trust banner ---------- */
.kk-secure-note {
    margin: 20px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.kk-trust-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.kk-trust-icons img { height: 20px; width: auto; opacity: 0.85; }

/* ---------- Site footer ---------- */
.kk-site-footer {
    margin-top: 28px;
    padding: 18px 0 20px;
    border-top: 1px solid var(--hairline);
    text-align: center;
}
.kk-site-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--sans);
}
.kk-site-footer__links a { color: var(--text-muted); }
.kk-site-footer__links a:hover { color: var(--brand-red); }
.kk-site-footer__links li:not(:first-child)::before {
    content: '·';
    margin-right: 14px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ---------- 3DS popup & overlay ---------- */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 25, 18, 0.5);
    z-index: 1000;
}
.popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(95vw, 480px);
    height: min(95vh, 720px);
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: 0 20px 50px rgba(31, 25, 18, 0.3);
    z-index: 1001;
    overflow: hidden;
}
.overlay.is-open, .popup.is-open { display: block; }
.popup iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Embed mode (iframe context) ---------- */
body.mode-embed { background: transparent; }
body.mode-embed .kk-checkout { padding-top: 8px; max-width: 100%; }
body.mode-embed .kk-header { padding-bottom: 12px; }
body.mode-embed .kk-site-footer { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 540px) {
    .kk-checkout { padding: 16px 14px 0; gap: 18px; }
    .kk-helpline { font-size: 12px; }
    .kk-heading { font-size: 24px; }
    .kk-subheading { font-size: 19px; }
    .kk-amount { padding: 14px 16px; }
    .kk-method-card { padding: 14px 16px; }
    .kk-field-row { grid-template-columns: 1fr; }
    .kk-site-footer__links { gap: 10px; font-size: 11px; }
    .kk-site-footer__links li:not(:first-child)::before { margin-right: 10px; }
}
