/* ============================================================
   RESTAURANT HERO
   ============================================================ */
.restaurant-hero-wrap {
    background: #f8fbff;
    border-bottom: 1px solid var(--line);
}

.restaurant-name {
    font-size: clamp(1.55rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--ink-900);
    margin-bottom: .7rem;
}

.restaurant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
    margin-bottom: 1rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: var(--ink-700);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .22rem .65rem;
    white-space: nowrap;
}

.meta-chip i {
    color: var(--brand-500);
    font-size: .78rem;
    flex-shrink: 0;
}

.restaurant-desc {
    color: var(--ink-700);
    font-size: .95rem;
    line-height: 1.6;
    max-width: 60ch;
    margin-bottom: 1rem;
}

.restaurant-image-card {
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(18, 40, 88, .14);
    aspect-ratio: 1 / 1;
    background: #e5edff;
    max-width: 480px;
    margin-left: auto;
}

.restaurant-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================================
   CALENDAR SECTION
   ============================================================ */
.calendar-section {
    padding: 1.5rem 0 2rem;
}

.cal-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: .9rem;
}

/* Toolbar */
.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .65rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.cal-toolbar .form-select {
    width: auto;
    min-width: min(44vw, 155px);
    font-size: .875rem;
}

.cal-toolbar .month-year {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: .5rem .65rem;
    margin-left: auto;
}

.cal-toolbar .form-group label {
    font-size: .75rem;
    margin-bottom: .18rem;
    display: block;
    color: var(--ink-500);
    font-weight: 600;
}

.cal-toolbar .month-year .form-select {
    min-width: 0 !important;
    width: 100%;
}

/* Calendar card */
.calendar-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(18, 40, 88, .05);
}

/* Nav bar */
.cal-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .65rem 1rem;
    background: #fafcff;
    border-bottom: 1px solid var(--line);
}

.cal-nav-bar h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--ink-900);
}

.cal-nav-bar .btn {
    padding: .32rem .6rem;
    color: var(--ink-500);
    border-color: var(--line);
    line-height: 1;
}

.cal-nav-bar .btn:hover {
    background: #eff4ff;
    border-color: var(--brand-500);
    color: var(--brand-600);
}

/* Table */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table thead th {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-500);
    background: #f8f9fb;
    padding: .5rem .2rem;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.calendar-table td {
    height: clamp(70px, 12vw, 94px);
    vertical-align: top;
    padding: .35rem .3rem .3rem;
    border: 1px solid #edf1f8;
    position: relative;
    transition: background .12s ease;
}

.cal-day-num {
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: .3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

/* Today highlight */
.calendar-table td.cal-today .cal-day-num {
    background: var(--brand-600);
    color: #fff;
    border-radius: 50%;
    font-size: .75rem;
}

/* Out of month */
.calendar-table td.cal-out-of-month {
    background: #f8f9fc;
}

.calendar-table td.cal-out-of-month .cal-day-num {
    color: #c8d0db;
}

/* Past */
.calendar-table td.cal-past {
    background: #fafafa;
}

.calendar-table td.cal-past .cal-day-num {
    color: #c8d0db;
}

/* Available */
.calendar-table td.cal-available {
    background: #f0fdf4;
    cursor: pointer;
}

.calendar-table td.cal-available:hover {
    background: #dcfce7;
}

.calendar-table td.cal-available:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: -2px;
}

/* Limited */
.calendar-table td.cal-limited {
    background: #fffbeb;
    cursor: pointer;
}

.calendar-table td.cal-limited:hover {
    background: #fef3c7;
}

.calendar-table td.cal-limited:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: -2px;
}

/* Explicitly unavailable */
.calendar-table td.cal-unavailable-explicit .cal-day-num {
    text-decoration: line-through;
    opacity: .45;
}

/* Status badge inside cell */
.cal-status-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .67rem;
    font-weight: 700;
    padding: .17rem .42rem;
    border-radius: 999px;
    line-height: 1.25;
    white-space: nowrap;
}

.cal-status-badge.available {
    background: #bbf7d0;
    color: #14532d;
}

.cal-status-badge.limited {
    background: #fde68a;
    color: #78350f;
}

/* Alert button inside unavailable cell */
.cal-alert-btn {
    display: block;
    margin-top: .3rem;
    font-size: .65rem;
    font-weight: 600;
    padding: .2rem .3rem;
    border-radius: .4rem;
    text-align: center;
    background: none;
    border: 1px solid #d0d7e6;
    color: var(--brand-600);
    text-decoration: none;
    line-height: 1.3;
    transition: background .12s, border-color .12s;
}

.cal-alert-btn:hover {
    background: #eff4ff;
    border-color: var(--brand-500);
}

/* Calendar legend */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    align-items: center;
    padding: .6rem 1rem;
    background: #fafcff;
    border-top: 1px solid var(--line);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    color: var(--ink-500);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.available { background: #22c55e; }
.legend-dot.limited   { background: #f59e0b; }
.legend-dot.none      { background: #d1d5db; }

/* ============================================================
   TIMES MODAL
   ============================================================ */
.times-modal .modal-dialog {
    max-width: 420px;
}

.times-modal .modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.times-modal .modal-header {
    background: linear-gradient(135deg, #0b57d0 0%, #2f7eff 100%);
    border-bottom: none;
    padding: 1rem 1.1rem .85rem;
    align-items: flex-start;
}

.times-modal .modal-title-text {
    font-size: .78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .75);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .2rem;
}

.times-modal .modal-date-display {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.times-modal .btn-close {
    filter: invert(1) brightness(2);
    opacity: .75;
    margin-top: .1rem;
}

.times-modal .btn-close:hover {
    opacity: 1;
}

.times-modal .modal-body {
    padding: 1rem 1.1rem;
    max-height: 55vh;
    overflow-y: auto;
}

.meal-section-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-500);
    margin: .9rem 0 .5rem;
}

.meal-section-label:first-child {
    margin-top: 0;
}

.meal-section-label i {
    color: var(--brand-500);
    font-size: .8rem;
}

.times-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.time-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .4rem .7rem;
    border-radius: .55rem;
    font-size: .875rem;
    font-weight: 700;
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--ink-900);
    text-decoration: none;
    transition: all .13s ease;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.time-chip i {
    font-size: .75rem;
    color: var(--ink-500);
}

.time-chip:hover {
    border-color: var(--brand-500);
    background: #eff4ff;
    color: var(--brand-700);
}

.time-chip:hover i {
    color: var(--brand-500);
}

/* CTA footer */
.modal-cta-section {
    padding: .85rem 1.1rem 1rem;
    border-top: 1px solid var(--line);
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.modal-cta-hint {
    font-size: .75rem;
    color: var(--ink-500);
    text-align: center;
}

/* Mobile: bottom sheet */
@media (max-width: 575.98px) {
    .times-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .times-modal .modal-content {
        border-radius: 1.25rem 1.25rem 0 0;
    }

    .times-modal .modal-body {
        max-height: 50vh;
    }

    .cal-toolbar {
        align-items: flex-start;
    }

    .cal-toolbar .month-year {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .restaurant-image-card {
        aspect-ratio: 4 / 3;
        border-radius: 1rem;
        max-width: 100%;
    }
}
