/* =====================================================
   ФАЙЛ: assets/css/booking-calendar.css
   Підключати в functions.php через wp_enqueue_style()
   ===================================================== */

/* --- Overlay --- */
.booking-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.booking-overlay.is-open {
    display: flex;
}

/* --- Modal box --- */
.booking-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 4px;
    padding: 32px 28px 28px;
    position: relative;
    font-family: inherit;
}

/* --- Close btn --- */
.booking-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    color: #444;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
}
.booking-close:hover { color: #000; }

/* --- Title --- */
.booking-title {
    text-align: center;
    font-size: 22px;
    font-weight: 500;
    color: #1a1a0e;
    margin: 0 0 24px;
    line-height: 1.35;
}

/* --- Tabs --- */
.booking-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.booking-tab {
    padding: 7px 18px;
    border: 1px solid #d4cead;
    border-radius: 3px;
    background: transparent;
    color: #46421C;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}
.booking-tab:hover {
    background: #f0ece0;
}
.booking-tab.active {
    background: #6b6440;
    color: #fff;
    border-color: #6b6440;
}

/* --- Month nav --- */
.booking-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.booking-month-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    padding: 4px 10px;
    transition: color 0.2s;
    line-height: 1;
}
.booking-month-btn:hover { color: #000; }
.booking-month-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #1a1a0e;
    text-transform: uppercase;
}

/* --- Legend --- */
.booking-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 11px;
    color: #666;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.legend-free     { background: transparent; border: 1.5px solid #aaa; }
.legend-busy     { background: #aaa; }
.legend-selected { background: #b5a96a; }

.booking-selected-range {
    margin-left: auto;
    font-size: 12px;
    color: #46421C;
    font-weight: 500;
}

/* --- Calendar grid --- */
.booking-calendar-wrap {
    margin-bottom: 24px;
}
.booking-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.booking-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    letter-spacing: 0.04em;
    padding: 4px 0;
    text-transform: uppercase;
}

.booking-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* --- Day cell --- */
.booking-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #1a1a0e;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    position: relative;
}
.booking-day:hover:not(.is-empty):not(.is-busy):not(.is-past) {
    background: #f0ece0;
}

/* Порожня клітинка (зміщення) */
.booking-day.is-empty {
    cursor: default;
}

/* Минулі дні */
.booking-day.is-past {
    color: #ccc;
    cursor: default;
}

/* Зайняті */
.booking-day.is-busy {
    color: #aaa;
    cursor: not-allowed;
}
.booking-day.is-busy::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #d0ccc0;
}

/* Вибрані — перший і останній день */
.booking-day.is-selected-start,
.booking-day.is-selected-end {
    background: #6b6440;
    color: #fff;
    border-radius: 3px;
    font-weight: 600;
    z-index: 1;
}

/* Діапазон між першим і останнім */
.booking-day.is-in-range {
    background: #e8e3d0;
    color: #46421C;
    border-radius: 0;
}
.booking-day.is-in-range:first-child,
.booking-day.is-selected-start + .booking-day.is-in-range {
    border-radius: 3px 0 0 3px;
}

/* Сьогодні */
.booking-day.is-today:not(.is-selected-start):not(.is-selected-end) {
    font-weight: 700;
    color: #46421C;
}

/* Loading */
.booking-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    font-size: 13px;
    padding: 20px;
}

/* --- Form --- */
.booking-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.booking-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 420px) {
    .booking-form-row { grid-template-columns: 1fr; }
}

.booking-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.booking-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #888;
    text-transform: uppercase;
}
.booking-input {
    padding: 10px 12px;
    border: 1px solid #d4cead;
    border-radius: 3px;
    font-size: 13px;
    color: #1a1a0e;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.booking-input:focus {
    border-color: #6b6440;
}
.booking-input::placeholder {
    color: #bbb;
}
.booking-textarea {
    resize: vertical;
    min-height: 90px;
}

/* --- Message --- */
.booking-message {
    display: none;
    padding: 10px 14px;
    border-radius: 3px;
    font-size: 13px;
}
.booking-message.is-error {
    display: block;
    background: #fce4ec;
    color: #c62828;
    border-left: 3px solid #ef4444;
}
.booking-message.is-success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 3px solid #22c55e;
}

/* --- Submit button --- */
.booking-submit {
    width: 100%;
    padding: 14px 20px;
    background: #6b6440;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: background 0.2s;
}
.booking-submit:hover {
    background: #56512f;
}
.booking-submit:disabled {
    background: #bbb;
    cursor: not-allowed;
}

/* --- Disclaimer --- */
.booking-disclaimer {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}
