/* ── UB Rental Booking: Frontend Calendar ───────────────────────────────── */

.ubrb-section {
    margin: 32px 0;
    font-family: inherit;
}

.ubrb-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #222;
}

/* ── Slider container ───────────────────────────────────────────────────── */
.ubrb-calendar-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ubrb-calendar-track-outer {
    overflow: hidden;
    flex: 1;
}

.ubrb-calendar-track {
    display: flex;
    /* only one month visible at a time via .ubrb-month--visible */
}

/* ── Single Month ───────────────────────────────────────────────────────── */
.ubrb-month {
    display: none;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    /* Fixed height: always reserve space for 6 rows so the layout never reflows */
    min-height: 320px;
}

.ubrb-month--visible {
    display: flex;
}

.ubrb-month-header {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 14px;
    color: #111;
}

/* Day-of-week row */
.ubrb-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}

.ubrb-dow {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px 0;
}

/* Day grid */
.ubrb-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    grid-auto-rows: 36px; /* Fixed row height — prevents 6-row months from expanding */
}

/* Base day cell */
.ubrb-day {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background .15s, color .15s;
    padding: 0;
    font-family: inherit;
    color: #374151;
    width: 100%;
    height: 100%;
}

.ubrb-day--empty { cursor: default; }

/* Available */
.ubrb-day--available:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Booked */
.ubrb-day--booked {
    background: #fee2e2;
    color: #b91c1c;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: .75;
}

/* Unavailable (outside season) */
.ubrb-day--unavailable {
    color: #d1d5db;
    cursor: not-allowed;
}

/* Past */
.ubrb-day--past {
    color: #d1d5db;
    cursor: not-allowed;
}

/* Selected: check-in */
.ubrb-day--checkin {
    background: #1d4ed8;
    color: #fff;
    border-radius: 6px 0 0 6px;
}

/* Selected: check-out */
.ubrb-day--checkout {
    background: #1d4ed8;
    color: #fff;
    border-radius: 0 6px 6px 0;
}

/* In-range */
.ubrb-day--inrange {
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 0;
}

/* ── Nav buttons ────────────────────────────────────────────────────────── */
.ubrb-nav {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #374151;
    transition: background .15s, border-color .15s;
}

.ubrb-nav:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ubrb-nav:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ── Legend ─────────────────────────────────────────────────────────────── */
.ubrb-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 0.78rem;
    color: #6b7280;
}

.ubrb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ubrb-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.ubrb-swatch--available  { background: #dbeafe; border: 1px solid #93c5fd; }
.ubrb-swatch--booked     { background: #fee2e2; }
.ubrb-swatch--unavailable{ background: #f3f4f6; border: 1px solid #e5e7eb; }
.ubrb-swatch--selected   { background: #1d4ed8; }

/* ── Booking Summary ────────────────────────────────────────────────────── */
.ubrb-booking-summary {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.ubrb-summary-dates {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ubrb-summary-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ubrb-summary-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ubrb-summary-field span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111;
}

.ubrb-summary-arrow {
    font-size: 1.2rem;
    color: #9ca3af;
    align-self: flex-end;
    padding-bottom: 2px;
}

/* ── Action buttons ─────────────────────────────────────────────────────── */
.ubrb-actions {
    display: flex;
    gap: 10px;
}

.ubrb-btn {
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background .15s, opacity .15s;
}

.ubrb-btn--primary {
    background: #1d4ed8;
    color: #fff;
}

.ubrb-btn--primary:hover:not(:disabled) {
    background: #1e40af;
}

.ubrb-btn--primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ubrb-btn--secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ubrb-btn--secondary:hover {
    background: #f9fafb;
}

/* ── Messages ───────────────────────────────────────────────────────────── */
.ubrb-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
}

.ubrb-message--success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.ubrb-message--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ubrb-day { font-size: 0.72rem; }
    .ubrb-summary-dates { gap: 10px; }
    .ubrb-summary-arrow { display: none; }
}
