/* ===== Book a Table ===== */
.booking { padding: clamp(72px, 9vw, 120px) 0; background: var(--color-bg-soft); }
.booking-head { margin-bottom: clamp(32px, 4vw, 52px); }

.booking-grid {
    display: grid; align-items: stretch;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 36px);
}

/* ----- Table cards ----- */
.table-cards { display: grid; grid-template-rows: 1fr 1fr; gap: 24px; }

.table-card {
    position: relative; isolation: isolate;
    display: flex; align-items: center;
    min-height: 210px;
    background: #141813;
    border: 2px solid rgba(217, 192, 138, 0.14);
    border-radius: 12px;
    overflow: hidden;
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out),
                translate 0.45s var(--ease-out), border-color 0.4s ease, box-shadow 0.4s ease;
}
.table-card-media {
    position: absolute; inset: 0; z-index: -1;
    width: 100%; height: 100%;
    object-fit: cover; object-position: right center;
    transform: scale(1.12); transform-origin: right center;
    transition: transform 1.6s var(--ease-out);
}
.table-card.is-visible .table-card-media { transform: scale(1); }

/* One-off light sweep as the card arrives */
.table-card::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(234, 215, 173, 0.16) 50%, transparent 65%);
    transform: translateX(-100%);
}
.table-card.is-visible::before { animation: cardSweep 1.4s var(--ease-out) 0.6s both; }
.table-card.is-visible:nth-child(2)::before { animation-delay: 0.85s; }

/* Readability overlay behind the text (stronger on narrow cards) */
.table-card::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(90deg, rgba(20, 24, 19, 0.96) 0%, rgba(20, 24, 19, 0.85) 50%, rgba(20, 24, 19, 0) 85%);
    opacity: 0.6;
}

.table-card-body { position: relative; width: 52%; padding: 32px 0 32px clamp(24px, 3vw, 36px); }
.table-card-title {
    margin-bottom: 14px;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 700; line-height: 1.1;
    color: var(--color-cream);
}
.table-card-text {
    margin-bottom: 16px;
    font-size: 0.9rem; font-weight: 300; line-height: 1.7;
    color: rgba(237, 228, 211, 0.7);
}
.table-card-price { font-size: 0.95rem; font-weight: 600; color: var(--color-gold); }

/* Whole card is the click target for selecting a table type */
.table-card-select { position: static; width: 0; height: 0; cursor: pointer; }
.table-card-select::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 10px; }
.table-card-select:focus-visible { outline: none; }
.table-card-select:focus-visible::after { box-shadow: inset 0 0 0 2px var(--color-gold-light); }

.table-card.is-selected {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 1px rgba(217, 192, 138, 0.15), 0 14px 40px rgba(217, 192, 138, 0.12);
}
.table-card.is-popping { animation: cardPop 0.5s var(--ease-out); }

@media (hover: hover) {
    .table-card:hover { translate: 0 -4px; border-color: rgba(217, 192, 138, 0.55); }
    .table-card.is-selected:hover { border-color: var(--color-gold-light); }
    .table-card:hover .table-card-media { transform: scale(1.06); }
}

/* ----- Form panel ----- */
.booking-panel {
    padding: clamp(24px, 3.5vw, 40px);
    background: rgba(18, 21, 16, 0.45);
    border: 2px solid rgba(217, 192, 138, 0.14);
    border-radius: 12px;
}

.booking-notice {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: rgba(217, 192, 138, 0.08);
    border: 2px solid var(--color-gold);
    border-radius: 10px;
    font-size: 0.85rem; font-weight: 500; line-height: 1.5;
    color: var(--color-gold);
}
.booking-notice strong { font-weight: 700; }
.booking-notice-dot {
    position: relative; flex-shrink: 0;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-gold);
}
.booking-notice-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: var(--color-gold);
    animation: dotPulse 2s ease-out infinite;
}

.form-row { display: grid; gap: 18px 20px; margin-bottom: 18px; }
.form-row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.form-field label {
    display: block; margin-bottom: 8px;
    font-size: 0.85rem; font-weight: 500;
    color: rgba(237, 228, 211, 0.6);
    transition: color 0.3s ease;
}
.form-field:focus-within label { color: var(--color-gold); }

.booking-form input,
.booking-form select {
    display: block; width: 100%; height: 50px;
    padding: 0 16px;
    background: var(--color-bg);
    border: 1px solid rgba(217, 192, 138, 0.16);
    border-radius: 10px;
    font: inherit; font-size: 1rem; /* 16px stops iOS zooming on focus */
    color: var(--color-cream);
    color-scheme: dark;
    -webkit-appearance: none; appearance: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.booking-form select {
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d9c08a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
    cursor: pointer;
}
.booking-form select option { background: var(--color-bg); color: var(--color-cream); }
.booking-form input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.7; }
.booking-form input:hover, .booking-form select:hover { border-color: rgba(217, 192, 138, 0.35); }
.booking-form input:focus, .booking-form select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(217, 192, 138, 0.18);
}
.booking-form [aria-invalid="true"] { border-color: #d77a6a; }
.booking-form [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(215, 122, 106, 0.2); }

.field-error { display: block; margin-top: 6px; font-size: 0.78rem; color: #e0907f; }
.field-error:empty { display: none; }
.form-field.is-shaking { animation: fieldShake 0.4s ease; }

.form-actions { margin-top: 26px; }
.booking-submit {
    position: relative; overflow: hidden;
    gap: 10px; width: 100%;
    padding: 15px 24px;
    font-size: 1rem;
}
.booking-submit i { font-size: 1.25rem; transition: transform 0.4s var(--ease-out); }
.booking-submit::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    transition: left 0.8s var(--ease-out);
}
.booking-submit:hover::after { left: 130%; }
.booking-submit:hover i { transform: rotate(-12deg) scale(1.12); }

.form-status { margin-top: 14px; text-align: center; font-size: 0.85rem; color: var(--color-gold); }
.form-status:empty { display: none; }

/* Panel contents stagger in once the panel is revealed */
.booking-form > :not(h3) { opacity: 0; transform: translateY(16px); }
.booking-panel.is-visible .booking-form > :not(h3) { animation: fadeUp 0.8s var(--ease-out) both; }
.booking-panel.is-visible .booking-form > :nth-child(2) { animation-delay: 0.45s; }
.booking-panel.is-visible .booking-form > :nth-child(3) { animation-delay: 0.55s; }
.booking-panel.is-visible .booking-form > :nth-child(4) { animation-delay: 0.65s; }
.booking-panel.is-visible .booking-form > :nth-child(5) { animation-delay: 0.75s; }
.booking-panel.is-visible .booking-form > :nth-child(6) { animation-delay: 0.85s; }

@keyframes cardSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes cardPop   { 0% { scale: 1; } 40% { scale: 1.015; } 100% { scale: 1; } }
@keyframes dotPulse  { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3); opacity: 0; } }
@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .booking-grid { grid-template-columns: minmax(0, 1fr); }
    .table-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; }
    .table-card-body { width: 60%; }
    .table-card::after { opacity: 1; }
}

@media (max-width: 767px) {
    .table-cards { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .table-card-body { width: 55%; }
}

@media (max-width: 575px) {
    .table-card { min-height: 200px; }
    .table-card-body { width: 66%; padding: 24px 0 24px 20px; }
    .table-card-title { margin-bottom: 10px; font-size: 1.5rem; }
    .table-card-text { margin-bottom: 12px; font-size: 0.85rem; line-height: 1.6; }
    .table-card-price { font-size: 0.88rem; }

    .booking-notice { gap: 12px; margin-bottom: 20px; padding: 12px 14px; font-size: 0.8rem; }
    .form-row { gap: 16px 12px; margin-bottom: 16px; }
    .booking-form input, .booking-form select { height: 48px; padding: 0 14px; }
    .booking-form select { padding-right: 38px; background-position: right 14px center; }
    .booking-submit { padding: 14px 18px; font-size: 0.95rem; }
}

@media (max-width: 399px) {
    .form-row-2 { grid-template-columns: minmax(0, 1fr); }
    .table-card-body { width: 74%; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    .booking-form > :not(h3) { opacity: 1; transform: none; }
    .table-card-media { transform: none; }
    .table-card::before { display: none; }
}
