/*
 * Guest booking layout for /book and /book/confirm.
 * Visual tokens come from design-system.css (mesh, glass, buttons).
 */

.book-header,
.book-container {
    position: relative;
    z-index: 1;
}

.book-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.book-brand {
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 16px;
    color: var(--text-primary);
}

.book-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.book-hero h1 {
    margin: 0 0 8px;
    font-size: 32px;
    letter-spacing: normal;
    color: var(--text-primary);
}
.book-hero p {
    margin: 0 0 24px;
    color: var(--text-secondary);
    font-size: 15px;
}

.book-search {
    padding: 20px;
    margin-bottom: 24px;
}

.book-search-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.book-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}
.book-field span {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.book-search-form .btn {
    width: 100%;
}

.book-search-note {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    min-height: 18px;
}

.book-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.book-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-card-name {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
.book-card-meta {
    color: var(--text-secondary);
    font-size: 13px;
}

.book-card-price {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.book-card-price small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}
.book-card-disclaimer,
.book-quote-disclaimer {
    display: block;
    margin: 8px 0 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-secondary);
}
.book-quote-summary .book-confirm-row {
    margin-top: 6px;
}
.book-confirm-row--total {
    font-weight: 600;
}
.book-confirm-row--total strong,
.book-confirm-row--total span {
    color: var(--text-primary);
    font-weight: 600;
}
.book-card .btn { align-self: stretch; margin-top: 8px; }

.book-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 32px 12px;
}

.book-search > *,
.book-card > *,
.book-modal-panel > *,
.book-confirm-card > * {
    position: relative;
    z-index: 2;
}

/* Modal — display:flex must not override HTML hidden */
.book-modal[hidden] {
    display: none !important;
}
.book-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 41, 59, 0.45);
}
.book-modal-panel {
    position: relative;
    z-index: 1;
    width: min(480px, 92vw);
    max-height: 92vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.book-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}
.book-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}
.book-modal-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#bookGuestFields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#bookGuestFields[hidden] {
    display: none !important;
}

.book-quote-summary {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-secondary);
}
.book-quote-summary strong {
    color: var(--text-primary);
    font-size: 15px;
    display: block;
}

.book-form-error {
    min-height: 18px;
    color: var(--coral);
    font-size: 13px;
}

.book-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.book-confirm-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.book-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding: 8px 0;
    font-size: 14px;
}
.book-confirm-row:last-child { border-bottom: none; }
.book-confirm-row strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Visible booking steps (Phase 6) */
.book-steps {
    list-style: none;
    display: flex;
    margin: 0 0 20px;
    padding: 0;
    counter-reset: book-step;
}

.book-step {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding-top: 22px;
    counter-increment: book-step;
}

.book-step::before {
    content: counter(book-step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

.book-step::after {
    content: '';
    position: absolute;
    top: 9px;
    left: calc(50% + 13px);
    right: calc(-50% + 13px);
    height: 2px;
    background: rgba(0, 0, 0, 0.08);
}

.book-step:last-child::after { display: none; }

.book-step--active {
    color: var(--text-primary);
}

.book-step--active::before {
    background: var(--accent);
    color: #fff;
}

.book-step--done {
    color: var(--text-secondary);
}

.book-step--done::before {
    content: '\2713';
    background: var(--green, #16a34a);
    color: #fff;
}

/* Alternative dates when a search has no availability (Phase 6) */
.book-alternatives {
    margin-top: 16px;
    padding: 20px;
}

.book-alternatives h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.book-alternative {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    font-size: 14px;
}

.book-alternative:last-child { border-bottom: none; }

/* Distinct verified states on the confirmation (Phase 6) */
.book-confirm-status {
    display: inline-block;
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.book-confirm-status--confirmed {
    background: rgba(22, 163, 74, 0.12);
    color: var(--green, #16a34a);
    border: 1px solid rgba(22, 163, 74, 0.25);
}

.book-confirm-status--pending {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.book-confirm-status--cancelled {
    background: rgba(220, 38, 38, 0.1);
    color: var(--coral, #dc2626);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

@media (max-width: 720px) {
    .book-search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .book-search-form .btn { grid-column: 1 / -1; }
    .book-hero h1 { font-size: 24px; }
    .book-step { font-size: 11px; }
    .book-alternative { flex-direction: column; align-items: flex-start; }
}
