/* ==========================================================================
   BOOKING SYSTEM STYLES
   ========================================================================== */

/* ─── Availability Calendar Section ─────────────────────────── */
.availability-section {
    background-color: var(--card-bg);
    padding: 4rem 2rem;
    border-top: 1px solid var(--border-color);
}

.availability-container {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.availability-header {
    margin-bottom: 2rem;
}

.availability-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.availability-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.availability-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.available { background: #27ae60; }
.legend-dot.partial { background: var(--primary-yellow); }
.legend-dot.full { background: #e74c3c; }
.legend-dot.closed { background: #bdc3c7; }

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cal-nav button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cal-nav button:hover {
    border-color: var(--primary-yellow);
    background: rgba(241, 196, 15, 0.1);
}

.cal-nav h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.4rem 0;
    text-transform: uppercase;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    position: relative;
    padding: 0.2rem;
}

.cal-day-num {
    line-height: 1;
}

.cal-booked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    background: rgba(17, 24, 39, 0.12);
    color: #111827;
}

.cal-day.partial .cal-booked-badge {
    background: rgba(201, 160, 0, 0.22);
    color: #8a6d00;
}

.cal-day.full .cal-booked-badge {
    background: rgba(231, 76, 60, 0.18);
    color: #c0392b;
}

.cal-day.empty { visibility: hidden; cursor: default; }
.cal-day.past { color: #ccc; cursor: default; }
.cal-day.closed { color: #aaa; background: #f0f0f0; }
.cal-day.available { background: rgba(39, 174, 96, 0.12); color: #27ae60; }
.cal-day.partial { background: rgba(241, 196, 15, 0.15); color: #c9a000; }
.cal-day.full { background: rgba(231, 76, 60, 0.12); color: #e74c3c; }

.cal-day.available:hover,
.cal-day.partial:hover,
.cal-day.full:hover {
    border-color: var(--primary-yellow);
    transform: scale(1.05);
}

.cal-day.selected {
    border: 2px solid var(--primary-yellow);
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}

.cal-load-error,
.cal-day-detail-placeholder,
.cal-day-detail-loading {
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.95rem;
}

.cal-day-detail {
    margin-top: 1.5rem;
    text-align: left;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.cal-day-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.cal-day-detail-header h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
}

.cal-book-btn {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, var(--primary-yellow), #f4c542);
    color: #111827;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
}

.cal-slots-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cal-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.cal-slot span {
    font-weight: 700;
}

.cal-slot.available {
    background: rgba(39, 174, 96, 0.1);
    color: #1e7e45;
}

.cal-slot.booked {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.cal-slot.blocked {
    background: #f3f4f6;
    color: #6b7280;
}

/* ─── Booking Modal ─────────────────────────────────────────── */
.booking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 20, 0.72);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(6px);
}

.booking-overlay.active {
    display: flex;
}

.booking-modal {
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
    border: 1px solid rgba(241, 196, 15, 0.18);
    border-radius: 22px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.booking-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.35rem 1.5rem 0.75rem;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #fffdf7 0%, rgba(255,255,255,0.95) 100%);
    z-index: 1;
}

.booking-modal-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
}

.booking-close {
    background: #f7f7f7;
    border: 1px solid #e5e7eb;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6b7280;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    transition: all 0.2s;
}

.booking-close:hover {
    background: #fff4c7;
    color: #111827;
    border-color: var(--primary-yellow);
}

/* Progress Steps */
.booking-steps {
    display: flex;
    gap: 0.4rem;
    padding: 0.3rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.step-indicator {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    position: relative;
    padding-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #fff;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 26px;
    z-index: 1;
}

.step-indicator.active::before {
    background: var(--primary-yellow);
    color: #111827;
}

.step-indicator.done::before {
    background: #27ae60;
    content: '✓';
    color: #fff;
}

.step-indicator.active { color: #111827; }

.booking-body {
    padding: 1.25rem 1.4rem 1rem;
}

.booking-step { display: none; }
.booking-step.active { display: block; }

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    background: #fcfcfc;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: #374151;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-group label .required {
    color: #e74c3c;
}

.form-group .hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.77rem;
    color: #6b7280;
}

.booking-modal input,
.booking-modal select,
.booking-modal textarea,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem 1.05rem;
    min-height: 54px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 4px rgba(241, 196, 15, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Vehicle Type Selector */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.vehicle-option {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.8rem 0.4rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.vehicle-option i {
    font-size: 1.4rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.3rem;
}

.vehicle-option span {
    font-size: 0.8rem;
    font-weight: 600;
}

.vehicle-option:hover {
    border-color: rgba(241, 196, 15, 0.5);
}

.vehicle-option.selected {
    border-color: var(--primary-yellow);
    background: rgba(241, 196, 15, 0.1);
    box-shadow: inset 0 0 0 1px rgba(241, 196, 15, 0.22);
}

.vehicle-option.selected i {
    color: #c9a000;
}

/* Service Selector */
.service-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.service-option {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    background: #ffffff;
}

.service-option-image {
    width: 72px;
    height: 54px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

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

.service-option-info {
    flex: 1;
    min-width: 0;
}

.service-option:hover {
    border-color: rgba(241, 196, 15, 0.5);
}

.service-option.selected {
    border-color: var(--primary-yellow);
    background: rgba(241, 196, 15, 0.1);
    box-shadow: inset 0 0 0 1px rgba(241, 196, 15, 0.18);
}

.service-option-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.service-option-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.service-option-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #c9a000;
    white-space: nowrap;
}

/* Addons */
.addon-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.addon-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.addon-option:hover {
    border-color: rgba(241, 196, 15, 0.5);
}

.addon-option.selected {
    border-color: var(--primary-yellow);
    background: rgba(241, 196, 15, 0.06);
}

.addon-option input[type="checkbox"] {
    accent-color: var(--primary-yellow);
    width: 18px;
    height: 18px;
}

.addon-option-info {
    flex: 1;
}

.addon-option-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.addon-option-price {
    font-weight: 700;
    color: #c9a000;
    font-size: 0.9rem;
}

/* Time Slots */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.time-slot {
    padding: 0.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    background: #ffffff;
}

.time-slot:hover {
    border-color: var(--primary-yellow);
}

.time-slot.selected {
    background: var(--primary-yellow);
    border-color: var(--primary-yellow);
    color: var(--text-main);
}

.time-slot.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.no-slots-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.95rem;
}

/* Summary */
.booking-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.8rem;
    font-weight: 800;
    font-size: 1.05rem;
}

.summary-label { color: var(--text-muted); }

/* Modal Footer Buttons */
.booking-footer {
    display: flex;
    gap: 0.8rem;
    padding: 0.75rem 1.4rem 1.25rem;
    border-top: 1px solid rgba(229,231,235,0.9);
    background: rgba(255,255,255,0.9);
}

.btn-secondary {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.btn-primary {
    flex: 2;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-yellow), #f4c542);
    color: #111827;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 8px 18px rgba(241, 196, 15, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(241, 196, 15, 0.26);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.btn-next {
    flex: 2;
}

.booking-error {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.24);
    color: #b42318;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

.booking-error.visible { display: block; }

/* Success Screen */
.booking-success {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, #f7fff7 0%, #ffffff 100%);
    border-radius: 16px;
}

.booking-success i {
    font-size: 3.5rem;
    color: #27ae60;
    margin-bottom: 1rem;
}

.booking-success h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.booking-success p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Address autocomplete dropdown */
.address-suggestions {
    position: relative;
}

.address-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.address-dropdown.visible { display: block; }

.address-dropdown-item {
    padding: 0.75rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.4;
}

.address-dropdown-item:hover,
.address-dropdown-item.active {
    background: rgba(241, 196, 15, 0.12);
}

.address-dropdown-item:last-child { border-bottom: none; }

.address-dropdown-loading,
.address-dropdown-empty {
    color: #6b7280;
    cursor: default;
    font-style: italic;
}

.address-dropdown-loading:hover,
.address-dropdown-empty:hover {
    background: transparent;
}

.address-suggestions:focus-within .address-dropdown.visible {
    border-color: var(--primary-yellow);
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .vehicle-grid { grid-template-columns: repeat(2, 1fr); }
    .time-slots-grid { grid-template-columns: repeat(2, 1fr); }
    .booking-modal { max-height: 95vh; border-radius: 12px; }
    .booking-steps { padding: 0.2rem 0.8rem 0.8rem; }
    .step-indicator { font-size: 0.65rem; }
    .availability-section { padding: 3rem 1rem; }
    .cal-day { font-size: 0.78rem; }
    .cal-day-detail-header { flex-direction: column; align-items: flex-start; }
}
