/**
 * Rezervační stránka — styly.
 * Barvy laděné do webu: zelená #87ba41 (akcent), olivová #2c3e1c (tmavá).
 */

.rezervace-page {
    position: relative;
}

.rezervace-section {
    position: relative;
    z-index: 1;
    padding: 48px 16px 80px;
}

.rezervace-container {
    max-width: 920px;
    margin: 0 auto;
}

.rezervace-intro {
    max-width: 680px;
    margin: 0 auto 8px;
    text-align: center;
}

.rezervace-header {
    text-align: center;
    margin-bottom: 28px;
}

.rezervace-header h1 {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.15;
    color: #2c3e1c;
    margin: 0 0 12px;
}

.rezervace-header p {
    font-size: 1.05rem;
    color: #4b5563;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- Kalendář ---------- */
.rezervace-calendar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(44, 62, 28, 0.06);
    transition: opacity 0.3s ease;
}

.rezervace-calendar.is-collapsed {
    opacity: 0.55;
}

.rezervace-weeknav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.rez-range {
    font-weight: 700;
    color: #2c3e1c;
    font-size: 1.05rem;
    text-align: center;
    flex: 1;
}

.rez-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #cfe0b3;
    background: #fff;
    color: #2c3e1c;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(44, 62, 28, 0.06);
}

.rez-nav svg {
    display: block;
}

.rez-nav:hover:not(:disabled) {
    background: #87ba41;
    border-color: #87ba41;
    color: #fff;
    box-shadow: 0 4px 10px rgba(135, 186, 65, 0.3);
}

.rez-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #9ca3af;
}

/* mřížka dnů */
.rezervace-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    min-height: 120px;
}

.rez-loading,
.rez-emptyweek {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    padding: 40px 8px;
}

/* Placeholder při načítání drží přibližnou výšku načteného týdne — jinak
   kalendář po AJAXu „vyskočil" a odsunul text pod sebou (Lighthouse CLS 0,17). */
.rez-loading {
    min-height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 860px) {
    .rez-loading {
        min-height: 520px;
    }
}

@media (max-width: 560px) {
    .rez-loading {
        min-height: 700px;
    }
}

.rez-day {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 12px;
    padding: 6px 6px 8px;
    background: #fbfcf9;
    border: 1px solid #f0f2ea;
}

/* Dny bez nabídky (víkend, minulost) — vizuálně potlačené, ne plná karta. */
.rez-day.is-empty {
    background: transparent;
    border-color: transparent;
}

.rez-day-head {
    text-align: center;
    padding: 4px 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eceee5;
}

.rez-dow {
    display: block;
    font-weight: 700;
    color: #2c3e1c;
    font-size: 0.92rem;
    line-height: 1.2;
}

.rez-date {
    display: block;
    font-size: 0.76rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* Dnešek — zvýrazněná „pilulka" v hlavičce. */
.rez-day.is-today {
    border-color: #cfe0b3;
    background: #f6faef;
}

/* Dnešek bez volných slotů: jen pilulka v hlavičce, žádný vysoký zelený
   box přes celou výšku řádku (pravidlo .is-today jinak přebije .is-empty). */
.rez-day.is-today.is-empty {
    background: transparent;
    border-color: transparent;
}

.rez-day.is-today.is-empty .rez-day-head {
    border-bottom-color: #eceee5;
}

.rez-day.is-today .rez-day-head {
    border-bottom-color: #cfe0b3;
}

.rez-day.is-today .rez-dow {
    display: inline-block;
    background: #87ba41;
    color: #fff;
    padding: 1px 10px;
    border-radius: 999px;
}

.rez-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

.rez-slot-btn {
    border: 1px solid #cfe0b3;
    background: #fff;
    color: #2c3e1c;
    border-radius: 10px;
    padding: 10px 4px;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
    box-shadow: 0 1px 2px rgba(44, 62, 28, 0.05);
}

.rez-slot-btn:hover {
    background: #87ba41;
    border-color: #87ba41;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(135, 186, 65, 0.35);
}

.rez-slot-btn:active {
    transform: translateY(0);
}

/* Placeholder prázdného dne — jemný, svisle vystředěný. */
.rez-noslot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    text-align: center;
    color: #c2cbb6;
    font-size: 0.8rem;
}

.rezervace-legend {
    margin: 18px 0 0;
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
}

.rezervace-legend a,
.rez-link {
    color: #7aaa38;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

/* ---------- Formulář ---------- */
.rezervace-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(44, 62, 28, 0.06);
}

.rez-chosen {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #f6faef;
    border: 1px solid #d7e3c4;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.rez-chosen-label {
    color: #6b7280;
}

.rez-chosen strong {
    color: #2c3e1c;
}

.rez-change {
    margin-left: auto;
    background: none;
    border: none;
    color: #7aaa38;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.rez-types {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

/* Selektor .rez-types .rez-type (0,2,0) přebije .rez-field label (0,1,1) —
   to dávalo kartám typu display:block (flex/gap se neuplatnily, radio bylo
   nalepené na textu a nezarovnané) + margin-bottom 6 px. */
.rez-types .rez-type {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.97rem;
    font-weight: 600;
    color: #2c3e1c;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.rez-type:hover {
    border-color: #a8c97a;
    background: #fbfdf7;
}

.rez-type:has(input:checked) {
    border-color: #87ba41;
    background: #f6faef;
    box-shadow: 0 0 0 1px #87ba41 inset;
}

/* Vlastní radio — nativní vzhled (tmavý kroužek Windows/Chrome) se tloukl
   s designem webu. appearance:none + vnitřní tečka přes ::before. */
.rez-type input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 0;
    border: 2px solid #c3cbb4;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: border-color 0.12s ease;
}

.rez-type input[type="radio"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #87ba41;
    transform: scale(0);
    transition: transform 0.12s ease;
}

.rez-type input[type="radio"]:checked {
    border-color: #87ba41;
}

.rez-type input[type="radio"]:checked::before {
    transform: scale(1);
}

.rez-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rez-field {
    margin-bottom: 16px;
}

.rez-field label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 0.92rem;
}

/* Plnou šířku jen textová pole — NE radio/checkbox (ty by se jinak roztáhly
   na 100 % a rozhodily layout přepínačů typu i řádku se souhlasem). */
.rez-field input:not([type="checkbox"]):not([type="radio"]),
.rez-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.rez-field input:not([type="checkbox"]):not([type="radio"]):hover:not(:focus),
.rez-field textarea:hover:not(:focus) {
    border-color: #b6c0a4;
}

.rez-field ::placeholder {
    color: #9aa094;
    opacity: 1;
}

.rez-field input:focus,
.rez-field textarea:focus {
    outline: none;
    border-color: #87ba41;
    box-shadow: 0 0 0 3px rgba(135, 186, 65, 0.18);
}

.rez-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 16px;
}

/* Honeypot — neviditelné pro lidi, mimo tab pořadí. */
.rez-hp {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* GDPR souhlas */
.rez-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    cursor: pointer;
}

/* Selektor input[type="checkbox"] (specificita 0,2,1) přebije .rez-field input
   { width:100% } (0,2,0) — bez toho by checkbox dědil 100% šířku a odmáčkl text.
   Vlastní vzhled ze stejného důvodu jako radio (nativní checkbox se tloukl
   s designem); fajfka přes clip-path na ::before. */
.rez-consent input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 1px 0 0 0;
    border: 2px solid #c3cbb4;
    border-radius: 6px;
    background: #fff;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.rez-consent input[type="checkbox"]::before {
    content: "";
    width: 11px;
    height: 11px;
    background: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 82% 0, 43% 60%);
    transform: scale(0);
    transition: transform 0.12s ease;
}

.rez-consent input[type="checkbox"]:checked {
    background: #87ba41;
    border-color: #87ba41;
}

.rez-consent input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.rez-consent a {
    color: #7aaa38;
}

/* Bannery (výsledek zrušení rezervace z e-mailu) */
.rez-banner {
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.rez-banner-ok {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.rez-banner-info {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.rez-banner-err {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.rez-submit {
    width: 100%;
    background: #87ba41;
    /* Tmavý text jako u „Přijmout" v cookie liště a CTA kalkulaček:
       bílá na #87ba41 měla kontrast jen 2,3:1, tmavá 7,4:1 (WCAG AA). */
    color: #191D14;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rez-submit:hover:not(:disabled) {
    background: #7aaa38;
}

.rez-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ---------- Úspěch ---------- */
.rezervace-success {
    text-align: center;
    background: #fff;
    border: 1px solid #d7e3c4;
    border-radius: 16px;
    padding: 40px 24px;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(44, 62, 28, 0.06);
}

.rez-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #87ba41;
    color: #fff;
    font-size: 2rem;
    line-height: 64px;
    margin: 0 auto 16px;
}

.rezervace-success h2 {
    color: #2c3e1c;
    margin: 0 0 8px;
}

.rezervace-success p {
    color: #4b5563;
    margin: 4px 0;
}

#rez-success-when {
    font-weight: 700;
    color: #2c3e1c;
}

.rezervace-fallback {
    text-align: center;
    color: #6b7280;
    margin-top: 28px;
}

.rezervace-fallback a {
    color: #7aaa38;
}

/* ---------- Responzivita ---------- */
@media (max-width: 860px) {
    .rezervace-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .rez-day:nth-child(n+5) {
        margin-top: 8px;
    }
}

@media (max-width: 560px) {
    .rezervace-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rez-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .rezervace-section {
        padding: 16px 10px 60px;
    }

    .rezervace-calendar,
    .rezervace-form {
        padding: 16px;
    }

    /* „Vybraný termín:" se na úzkém displeji nevešel vedle času a odkaz
       „změnit" padal na druhý řádek — bez popisku je box jednořádkový
       (čas + změnit vpravo), význam je z kontextu zřejmý. */
    .rez-chosen {
        padding: 10px 14px;
    }

    .rez-chosen-label {
        display: none;
    }

    /* Karty typu pod sebou na celou šířku nepotřebují min-width. */
    .rez-types .rez-type {
        min-width: 0;
        flex-basis: 100%;
    }
}

/* Kontrast textu (WCAG AA) — 10/2026: datum dne #9ca3af (2,5:1) → #6b7280 (4,8:1). */
.rez-date {
    color: #6b7280;
}

/* Posun na formulář/kalendář po výběru termínu: cíl nesmí skončit pod hlavičkou
   (mobil: fixní 57 px, desktop: sticky ~95 px + odsazení). */
.rezervace-form,
.rezervace-calendar,
.rezervace-success {
    scroll-margin-top: 130px;
}

@media (max-width: 991px) {
    .rezervace-form,
    .rezervace-calendar,
    .rezervace-success {
        scroll-margin-top: 76px;
    }
}

/* Na rezervační stránce plovoucí tlačítko (FAB) jen překrývá sloty a pole
   formuláře — telefon i e-mail jsou v textu stránky. */
main.rezervace-page ~ .fab {
    display: none;
}
