/**
 * Table Reservation Styles
 *
 * Frontend styles for table reservation booking interface
 */

.table-reservation-purchase-box {
    margin: 30px 0;
    padding: 25px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.table-reservation-purchase-box h3 {
    margin-top: 0;
    font-size: 24px;
}

/* Form Fields */
.table-reservation-form .form-field {
    margin-bottom: 20px;
}

.table-reservation-form .form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
}

.table-reservation-form .form-field .required {
    color: #e74c3c;
}

.table-reservation-form .form-field input[type="date"],
.table-reservation-form .form-field input[type="time"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.table-reservation-form .form-field input[type="date"]:focus,
.table-reservation-form .form-field input[type="time"]:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

/* Guest Counter Widget */
.guest-counter {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.guest-counter button {
    width: 45px;
    height: 45px;
    border: none;
    background: #f5f5f5;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-counter button:hover {
    background: #e0e0e0;
}

.guest-counter button:active {
    background: #d0d0d0;
}

.guest-counter button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.guest-counter input[type="number"] {
    width: 80px;
    height: 45px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 0;
    background: white;
}

.guest-counter input[type="number"]:focus {
    outline: none;
}

/* Hide number input spinners */
.guest-counter input[type="number"]::-webkit-inner-spin-button,
.guest-counter input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.guest-counter input[type="number"] {
    -moz-appearance: textfield;
}

.table-reservation-form .form-field .description {
    margin-top: 5px;
    font-size: 13px;
    font-style: italic;
    opacity: 0.7;
}

/* Availability Message */
.availability-message {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 600;
}

.availability-message.available {
    color: #27ae60;
}

.availability-message.unavailable {
    color: #e74c3c;
}

/* Price Display */
.price-display {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border: 2px solid #2c3e50;
    border-radius: 6px;
}

.price-breakdown {
    font-size: 16px;
}

.price-breakdown > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.price-breakdown .additional-guests-row {
    border-top: 1px solid #eee;
}

.price-breakdown .total-price-row {
    border-top: 2px solid currentColor;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 20px;
}

.price-breakdown .total-price {
    font-size: 24px;
    font-weight: 700;
}

/* House Rules */
.house-rules-field {
    margin: 25px 0;
    padding: 20px;
    background: #fff9e6;
    border: 1px solid #f1c40f;
    border-radius: 6px;
}

.house-rules-content {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.house-rules-acceptance {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.house-rules-acceptance input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Submit Button */
.table-reservation-form .single_add_to_cart_button {
    width: 100%;
    max-width: 400px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.table-reservation-form .single_add_to_cart_button:hover:not(:disabled) {
    background: #1a252f;
}

.table-reservation-form .single_add_to_cart_button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Out of Stock */
.table-reservation-purchase-box .out-of-stock {
    padding: 20px;
    background: #ffebee;
    border: 2px solid #e74c3c;
    border-radius: 6px;
    color: #c0392b;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-reservation-purchase-box {
        padding: 20px 15px;
    }

    .table-reservation-form .form-field input[type="date"],
    .table-reservation-form .form-field input[type="time"],
    .table-reservation-form .form-field select,
    .table-reservation-form .single_add_to_cart_button {
        max-width: 100%;
    }

    .price-breakdown .total-price {
        font-size: 20px;
    }
}

/* Admin Styles */
.acf-field[data-name="table_available_dates"] .acf-input,
.acf-field[data-name="table_blocked_dates"] .acf-input {
    position: relative;
}

.date-picker-button {
    margin-top: 10px;
}

/* Table Reservations List Page */
.table-reservations-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.date-selector {
    margin-bottom: 40px;
    padding: 25px;
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.date-selector h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
}

.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ddd;
}

.table-date-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.table-date-filter input[type="date"] {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.table-date-filter input[type="date"]:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

.table-date-filter button {
    padding: 10px 20px;
    font-size: 16px;
}

.selected-date-display {
    margin-top: 15px;
    font-size: 15px;
}

.selected-date-display strong {
    font-weight: 600;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.table-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.table-card.available:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.table-card.unavailable {
    opacity: 0.6;
}

.table-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.table-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unavailable-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.unavailable-overlay span {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
}

.table-content {
    padding: 20px;
}

.table-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: bold;
}

.table-excerpt {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.table-details {
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item .label {
    font-weight: 600;
    font-size: 14px;
}

.detail-item .value {
    font-size: 14px;
}

.detail-item .value.price {
    font-size: 16px;
    font-weight: bold;
}

.reserve-button {
    display: block;
    width: auto;
    padding: 12px;
    margin-top: 15px;
    text-align: center;
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.reserve-button:hover {
    background: #1a252f;
    color: white;
}

.reserve-button.disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.no-tables {
    text-align: center;
    padding: 40px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .tables-grid {
        grid-template-columns: 1fr;
    }

    .table-date-filter {
        flex-direction: column;
    }

    .table-date-filter input[type="date"],
    .table-date-filter button {
        width: 100%;
    }
}

/* Datepicker: closed days + today-blocked styling */
.ui-datepicker .ui-datepicker-calendar td.tr-day-closed,
.ui-datepicker .ui-datepicker-calendar td.tr-day-blocked-today {
    opacity: 0.35;
}
.ui-datepicker .ui-datepicker-calendar td.tr-day-closed > span,
.ui-datepicker .ui-datepicker-calendar td.tr-day-blocked-today > span {
    color: #999;
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 4px,
        #ebebeb 4px,
        #ebebeb 8px
    );
    cursor: not-allowed;
}

/* ============================================================
   Shared reservation form (rendered as a table-card)
   ============================================================ */

.reservation-form-container {
    margin: 28px 0;
}

.table-card.reservation-form-card {
    max-width: 720px;
    margin: 0 auto;
    cursor: default;
    background: #fff;
    /* Text color is set once at the root — descendants inherit. To
       restyle the form's text color, override this selector alone. */
    color: #1d2327;
}

.table-card.reservation-form-card .table-content {
    padding: 24px 28px;
}

.reservation-form-heading {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.25;
}
.reservation-form-heading .selected-table-name {
    font-weight: 700;
}

.reservation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reservation-form .reservation-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-weight: 600;
}

.reservation-form .reservation-field .field-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reservation-form .reservation-field input[type="number"],
.reservation-form .reservation-field input[type="time"],
.reservation-form .reservation-field input[type="text"],
.reservation-form .reservation-field select {
    padding: 10px 12px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.reservation-form .reservation-field input:focus,
.reservation-form .reservation-field select:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* Snapshot date — rendered as plain text, not an input. */
.reservation-form .reservation-date-display .field-value {
    font-size: 15px;
    font-weight: 500;
}

/* Arrival time as a pill-style radio group */
.reservation-form .arrival-time-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.reservation-form .arrival-time-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.reservation-form .arrival-time-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.reservation-form .arrival-time-option:hover {
    border-color: #888;
}
.reservation-form .arrival-time-option:has(input:focus-visible) {
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.reservation-form .arrival-time-option:has(input:checked) {
    border-color: #1f1f1f;
    background: #1f1f1f;
    color: #fff;
}

/* Live preview block */
.reservation-preview {
    background: #faf6f1;
    border: 1px solid #ead9c4;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reservation-preview .preview-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 15px;
}

.reservation-preview .preview-label {
    font-weight: 500;
}

.reservation-preview .preview-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.reservation-preview .preview-row.preview-total {
    border-top: 1px solid #ead9c4;
    padding-top: 8px;
    margin-top: 4px;
    font-size: 17px;
}

.reservation-preview .preview-row.preview-total .preview-label,
.reservation-preview .preview-row.preview-total .preview-value {
    font-weight: 700;
}

.reservation-preview .preview-footer-note {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.reservation-preview .preview-footer-note > :first-child {
    margin-top: 0;
}

.reservation-preview .preview-footer-note > :last-child {
    margin-bottom: 0;
}

/* House rules block inside the form. Background is set once on the
   wrapper; summary, content, and nested page-content elements stay
   transparent so the wrapper's backdrop shows through. */
.reservation-form .reservation-house-rules {
    border: 1px solid #ead9c4;
    border-radius: 6px;
    padding: 0;
    background: #faf6f1;
    overflow: hidden;
}
.reservation-form .reservation-house-rules summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    list-style: revert;
}
.reservation-form .reservation-house-rules summary:hover {
    background: #f3ead9;
}
.reservation-form .reservation-house-rules[open] summary {
    border-bottom: 1px solid #ead9c4;
}
.reservation-form .reservation-house-rules .house-rules-content {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
.reservation-form .reservation-house-rules .house-rules-content,
.reservation-form .reservation-house-rules .house-rules-content * {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.reservation-form .reservation-accept-rules {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.reservation-form .reservation-accept-rules input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.15);
    accent-color: #d63366;
}

.reservation-form .reserve-submit,
.reservation-form button.reserve-submit,
.reservation-form button[type="submit"].reserve-submit {
    align-self: flex-start;
    margin-top: 8px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #d63366;
    color: #fff !important;
    border: 2px solid #d63366;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    width: auto;
    height: auto;
    min-height: 44px;
    display: inline-block;
}
.reservation-form .reserve-submit:hover,
.reservation-form .reserve-submit:focus {
    background: #b32957;
    border-color: #b32957;
    color: #fff !important;
}
.reservation-form .reserve-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .table-card.reservation-form-card .table-content {
        padding: 20px;
    }
    .reservation-form .reserve-submit {
        align-self: stretch;
    }
}
