/* ============================================
   Availability Calendar + Slots (shared)
   Used by: booking page, availability modal preview tab
   ============================================ */

/* Split layout: calendar + slots */
.avail-preview-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* Calendar panel */
.avail-cal-panel {
    padding: 2rem 2rem;
    display: flex;
    flex-direction: column;
}

/* Calendar navigation */
.avail-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.avail-cal-label {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    letter-spacing: -0.01em;
}
.avail-cal-arrows {
    display: flex;
    gap: 6px;
}
.avail-cal-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    color: #888;
    font-size: 0.85rem;
}
.avail-cal-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.avail-cal-btn:disabled { opacity: 0.35; cursor: default; }
.avail-cal-btn:disabled:hover { background: transparent; color: #888; border-color: #e0e0e0; }

/* Calendar grid */
.avail-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.avail-cal-dow {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0 0.75rem;
}
.avail-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: #333;
    position: relative;
    font-weight: 400;
}
.avail-cal-cell:hover:not(.is-empty):not(.is-unavailable):not(.is-selected):not(.is-past) {
    background: #f0f0f0;
}
.avail-cal-cell.is-empty {
    cursor: default;
    visibility: hidden;
}
.avail-cal-cell.is-unavailable {
    color: #d0d0d0;
    cursor: default;
}
.avail-cal-cell.is-unavailable:hover { background: none; }
.avail-cal-cell.is-past {
    color: #d0d0d0;
    cursor: default;
}
.avail-cal-cell.is-past:hover { background: none; }
.avail-cal-cell.is-today {
    font-weight: 600;
    color: var(--brand-primary);
}
.avail-cal-cell.is-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-primary);
}
.avail-cal-cell.is-available {
    font-weight: 500;
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}
.avail-cal-cell.is-available:hover:not(.is-selected) {
    background: color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.avail-cal-cell.is-selected {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 500;
}
.avail-cal-cell.is-today.is-selected::after {
    background: #fff;
}
.avail-cal-cell.is-selected:hover {
    background: var(--brand-primary);
}

/* Slots panel — height:0 prevents it from growing the grid row;
   min-height:100% stretches it to match the calendar column */
.avail-slots-panel {
    border-left: 1px solid #e5e7eb;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 0;
    min-height: 100%;
}
.avail-slots-day {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111;
    margin-bottom: 0.75rem;
}
.avail-slots-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    min-width: 1.5rem;
    margin-left: 0.125rem;
}
.avail-slots-scroll-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.avail-slots-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
    padding-bottom: 1rem;
}
.avail-slots-list::-webkit-scrollbar { width: 4px; }
.avail-slots-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Scroll arrows */
.avail-slots-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
    color: #999;
    font-size: 1rem;
    user-select: none;
}
.avail-slots-arrow:hover { opacity: 1; }
.avail-slots-arrow-up {
    top: 0;
    background: linear-gradient(to bottom, #fff 60%, transparent);
}
.avail-slots-arrow-down {
    bottom: 0;
    background: linear-gradient(to top, #fff 60%, transparent);
}

/* Individual slot */
.avail-slot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 80%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.avail-slot-btn:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
    color: #333;
}
.avail-slot-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    flex-shrink: 0;
}
.avail-slot-label {
    font-variant-numeric: tabular-nums;
}

/* Empty / loading / error states */
.avail-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #999;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.avail-empty i {
    font-size: 1.5rem;
    color: #ddd;
    margin-bottom: 0.5rem;
    display: block;
}
.avail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    flex: 1;
}
.avail-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--brand-primary) 15%, transparent);
    border-top-color: var(--brand-primary);
    animation: avail-spin 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes avail-spin { to { transform: rotate(360deg); } }
.avail-spin { animation: avail-spin 0.7s linear infinite; }

.avail-error {
    text-align: center;
    padding: 2rem 1rem;
    color: #dc2626;
    font-size: 0.8125rem;
}

/* Responsive: stack to single column on small screens */
@media (max-width: 640px) {
    .avail-preview-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .avail-cal-panel { padding: 1.5rem 1.25rem 1rem; }
    .avail-slots-panel {
        border-left: none;
        border-top: 1px solid #e5e7eb;
        padding: 1.25rem;
        height: auto;
        min-height: auto;
        max-height: 50vh;
    }
}
