/* ══════════════════════════════════════════
   AnnDy Extreme Booking – v4 (Timeline UX)
   ══════════════════════════════════════════ */

:root {
    --ab-base: #E4E2DD;
    --ab-dark: #1E1E1E;
    --ab-red: #DB4A2B;
    --ab-orange: #F8A348;
    --ab-green: #2ECC71;
    --ab-border: 3px solid #1E1E1E;
    --ab-font-h: 'Clash Display', sans-serif;
    --ab-font-b: 'Satoshi', sans-serif;
    --ab-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Modal Shell ── */
.ab-modal-booking {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ab-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(12px);
}

.ab-modal-content {
    position: relative;
    width: 92%;
    max-width: 560px;
    max-height: 92vh;
    background: var(--ab-base);
    border: 4px solid var(--ab-dark);
    box-shadow: 12px 12px 0 var(--ab-red);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ab-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2.2rem;
    color: var(--ab-base);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
}

.ab-modal-close:hover {
    transform: rotate(90deg);
    color: var(--ab-red);
}

/* ── Header ── */
.ab-modal-header {
    padding: 1.5rem 2rem 1.25rem;
    background: var(--ab-dark);
    color: var(--ab-base);
}

.ab-modal-title {
    font-family: var(--ab-font-h);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 1rem;
    line-height: 1;
}

.ab-progress {
    display: flex;
    align-items: center;
    gap: 0;
}

.ab-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ab-font-b);
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
}

.ab-step-dot.active {
    border-color: var(--ab-red);
    color: var(--ab-red);
}

.ab-step-dot.done {
    background: var(--ab-red);
    border-color: var(--ab-red);
    color: #fff;
}

.ab-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
}

/* ── Step Content ── */
.ab-form {
    padding: 1.75rem 2rem 2rem;
    flex: 1;
}

.ab-step h3 {
    font-family: var(--ab-font-h);
    font-size: 1.4rem;
    text-transform: uppercase;
    color: var(--ab-dark);
    margin: 0 0 1.25rem;
    line-height: 1.1;
}

.ab-step-hint {
    font-family: var(--ab-font-b);
    font-size: 0.85rem;
    color: rgba(30, 30, 30, 0.6);
    margin: -0.75rem 0 1rem;
}

/* ── Vehicle Picker ── */
.ab-vehicle-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ab-vehicle-opt input {
    display: none;
}

.ab-vehicle-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(30, 30, 30, 0.15);
    cursor: pointer;
    transition: 0.2s;
}

.ab-vehicle-card:hover {
    border-color: var(--ab-dark);
}

.ab-vehicle-opt input:checked+.ab-vehicle-card {
    background: var(--ab-dark);
    color: var(--ab-base);
    border-color: var(--ab-dark);
}

.ab-vehicle-emoji {
    font-size: 1.8rem;
}

.ab-vehicle-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ab-vehicle-label {
    font-family: var(--ab-font-h);
    font-weight: 700;
    font-size: 1rem;
}

.ab-vehicle-price {
    font-family: var(--ab-font-b);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ab-red);
}

.ab-vehicle-opt input:checked+.ab-vehicle-card .ab-vehicle-price {
    color: var(--ab-orange);
}

/* ── Stepper ── */
.ab-stepper {
    display: inline-flex;
    border: 2px solid var(--ab-dark);
}

.ab-stepper input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-family: var(--ab-font-h);
    font-size: 1.2rem;
    font-weight: 700;
}

.ab-stepper-btn {
    background: var(--ab-dark);
    color: var(--ab-base);
    border: none;
    padding: 0.4rem 0.9rem;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: var(--ab-font-h);
}

.ab-stepper-btn:hover {
    background: var(--ab-red);
}

/* ── Calendar ── */
.ab-calendar-wrapper {
    border: 2px solid var(--ab-dark);
    background: #fff;
}

.ab-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ab-dark);
    color: var(--ab-base);
    padding: 0.75rem 1rem;
}

.ab-cal-title {
    font-family: var(--ab-font-h);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ab-cal-nav {
    background: none;
    border: none;
    color: var(--ab-base);
    font-size: 1.3rem;
    cursor: pointer;
    transition: 0.15s;
}

.ab-cal-nav:hover {
    color: var(--ab-red);
}

.ab-cal-nav:disabled {
    opacity: 0.25;
    pointer-events: none;
}

.ab-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(30, 30, 30, 0.04);
    border-bottom: 2px solid var(--ab-dark);
}

.ab-cal-weekdays span {
    padding: 0.4rem 0;
    text-align: center;
    font-family: var(--ab-font-b);
    font-size: 0.7rem;
    font-weight: 700;
}

.ab-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.ab-cal-loading {
    grid-column: 1/-1;
    padding: 2rem;
    text-align: center;
    font-family: var(--ab-font-b);
    font-size: 0.85rem;
}

.ab-cal-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid rgba(30, 30, 30, 0.08);
    border-bottom: 1px solid rgba(30, 30, 30, 0.08);
    cursor: pointer;
    user-select: none;
    transition: 0.15s;
    padding: 2px;
}

.ab-cal-day:nth-child(7n) {
    border-right: none;
}

.ab-cal-num {
    font-family: var(--ab-font-h);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

/* Badge inside day cell */
.ab-cal-badge {
    font-family: var(--ab-font-b);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--ab-green);
    line-height: 1;
    margin-top: 1px;
}

/* Day states */
.ab-cal-empty {
    background: #f7f7f5;
    cursor: default;
}

.ab-cal-disabled {
    opacity: 0.2;
    pointer-events: none;
}

.ab-cal-partial {
    background: rgba(248, 163, 72, 0.1);
}

.ab-cal-partial .ab-cal-badge {
    color: var(--ab-orange);
}

.ab-cal-full {
    background: rgba(219, 74, 43, 0.08);
    cursor: not-allowed;
    opacity: 0.5;
}

.ab-cal-full .ab-cal-num {
    text-decoration: line-through;
}

.ab-cal-selected {
    background: var(--ab-dark) !important;
}

.ab-cal-selected .ab-cal-num {
    color: var(--ab-base);
}

.ab-cal-selected .ab-cal-badge {
    color: var(--ab-orange);
}

.ab-cal-day:hover:not(.ab-cal-empty):not(.ab-cal-disabled):not(.ab-cal-full):not(.ab-cal-selected) {
    background: rgba(30, 30, 30, 0.06);
}

/* Legend */
.ab-cal-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.ab-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--ab-font-b);
    font-size: 0.7rem;
    font-weight: 500;
}

.ab-legend-dot {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(30, 30, 30, 0.3);
}

.ab-legend-free {
    background: #fff;
}

.ab-legend-partial {
    background: rgba(248, 163, 72, 0.3);
}

.ab-legend-full {
    background: rgba(219, 74, 43, 0.2);
}

/* ══ TIMELINE ══ */
.ab-timeline-wrapper {
    margin-top: 0.5rem;
}

.ab-timeline {
    border: 2px solid var(--ab-dark);
    background: #fff;
}

.ab-tl-loading {
    padding: 2rem;
    text-align: center;
    font-family: var(--ab-font-b);
    font-size: 0.85rem;
}

.ab-tl-slot {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(30, 30, 30, 0.1);
    cursor: pointer;
    transition: background 0.15s;
    min-height: 42px;
}

.ab-tl-slot:last-of-type {
    border-bottom: none;
}

.ab-tl-slot:hover:not(.ab-tl-full):not(.ab-tl-selected) {
    background: rgba(30, 30, 30, 0.03);
}

.ab-tl-time {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ab-font-h);
    font-size: 0.85rem;
    font-weight: 700;
    border-right: 2px solid var(--ab-dark);
    background: rgba(30, 30, 30, 0.03);
}

.ab-tl-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    position: relative;
    overflow: hidden;
}

.ab-tl-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg, rgba(219, 74, 43, 0.1), rgba(219, 74, 43, 0.1) 6px, rgba(219, 74, 43, 0.18) 6px, rgba(219, 74, 43, 0.18) 12px);
    transition: width 0.3s;
}

.ab-tl-free {
    position: relative;
    z-index: 1;
    font-family: var(--ab-font-b);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ab-green);
}

/* Full slot */
.ab-tl-full {
    cursor: not-allowed;
    opacity: 0.5;
}

.ab-tl-full .ab-tl-bar {
    background: repeating-linear-gradient(45deg, rgba(219, 74, 43, 0.2), rgba(219, 74, 43, 0.2) 6px, rgba(219, 74, 43, 0.35) 6px, rgba(219, 74, 43, 0.35) 12px);
}

.ab-tl-full .ab-tl-free {
    color: var(--ab-red);
    font-weight: 700;
}

/* Selected block */
.ab-tl-selected {
    background: rgba(46, 204, 113, 0.12) !important;
}

.ab-tl-selected .ab-tl-time {
    background: var(--ab-dark);
    color: var(--ab-base);
}

.ab-tl-start .ab-tl-time {
    border-top: 3px solid var(--ab-green);
}

.ab-tl-end .ab-tl-time {
    border-bottom: 3px solid var(--ab-green);
}

.ab-tl-in-range {
    border-left: 3px solid var(--ab-green);
}

.ab-tl-end-label {
    /* 18:00 marker */
    padding: 0.25rem 0;
    text-align: center;
    font-family: var(--ab-font-h);
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(30, 30, 30, 0.03);
    border-top: 2px solid var(--ab-dark);
    color: rgba(30, 30, 30, 0.4);
}

.ab-tl-end {
    padding: 0.3rem;
    text-align: center;
    font-family: var(--ab-font-h);
    font-size: 0.75rem;
    background: rgba(30, 30, 30, 0.03);
    border-top: 2px solid var(--ab-dark);
    color: rgba(30, 30, 30, 0.4);
}

/* Timeline summary */
.ab-timeline-summary {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 2px dashed rgba(30, 30, 30, 0.2);
    background: rgba(46, 204, 113, 0.06);
    flex-wrap: wrap;
}

.ab-tl-sum-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 140px;
}

.ab-tl-sum-label {
    font-family: var(--ab-font-b);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

.ab-tl-sum-value {
    font-family: var(--ab-font-h);
    font-size: 1.1rem;
    font-weight: 700;
}

.ab-tl-sum-price {
    color: var(--ab-red);
    font-size: 1.3rem;
}

/* ── Recap (Step 4) ── */
.ab-booking-recap {
    border: 2px solid var(--ab-dark);
    margin-bottom: 1.5rem;
}

.ab-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(30, 30, 30, 0.08);
    font-family: var(--ab-font-b);
    font-size: 0.85rem;
}

.ab-recap-row:last-child {
    border-bottom: none;
}

.ab-recap-label {
    font-weight: 500;
    opacity: 0.7;
}

.ab-recap-val {
    font-weight: 700;
}

.ab-recap-total {
    background: var(--ab-dark);
    color: var(--ab-base);
}

.ab-recap-total .ab-recap-val {
    color: var(--ab-orange);
    font-family: var(--ab-font-h);
    font-size: 1.1rem;
}

/* ── Fields ── */
.ab-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.ab-field--full {
    grid-column: 1 / -1;
}

.ab-field label {
    font-family: var(--ab-font-b);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ab-dark);
}

.ab-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.ab-field input:not([type="radio"]):not([type="hidden"]),
.ab-field textarea {
    font-family: var(--ab-font-b);
    font-size: 0.95rem;
    background: transparent;
    border: 2px solid var(--ab-dark);
    padding: 0.8rem 1rem;
    outline: none;
    width: 100%;
}

.ab-field input:focus,
.ab-field textarea:focus {
    border-color: var(--ab-red);
    background: rgba(219, 74, 43, 0.02);
}

/* ── Actions ── */
.ab-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(0, 0, 0, 0.06);
}

.ab-btn-prev,
.ab-btn-next,
.ab-submit-btn {
    padding: 0.8rem 1.5rem;
    font-family: var(--ab-font-h);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.ab-btn-prev {
    background: transparent;
    color: var(--ab-dark);
    opacity: 0.5;
    padding-left: 0;
}

.ab-btn-prev:hover {
    opacity: 1;
    color: var(--ab-red);
}

.ab-btn-next {
    background: var(--ab-dark);
    color: var(--ab-base);
}

.ab-btn-next:hover {
    background: var(--ab-red);
}

.ab-submit-btn {
    background: var(--ab-dark);
    color: var(--ab-base);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ab-submit-btn:hover {
    background: var(--ab-red);
}

.ab-submit-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Error / Msg ── */
.ab-error {
    color: var(--ab-red);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.ab-form-msg {
    text-align: center;
    color: var(--ab-red);
    font-weight: 700;
    font-family: var(--ab-font-b);
    font-size: 0.85rem;
    min-height: 1.2rem;
}

/* ── Success ── */
.ab-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    min-height: 350px;
    gap: 1.5rem;
}

.ab-success-icon {
    font-size: 3.5rem;
    animation: abPop 0.5s var(--ab-ease);
}

.ab-success h3 {
    font-family: var(--ab-font-h);
    font-size: 2rem;
    color: var(--ab-dark);
    text-transform: uppercase;
    line-height: 1;
}

.ab-success p {
    font-family: var(--ab-font-b);
    opacity: 0.7;
    max-width: 280px;
    line-height: 1.5;
}

.ab-btn-secondary {
    background: transparent;
    border: 2px solid var(--ab-dark);
    padding: 0.8rem 1.5rem;
    font-family: var(--ab-font-h);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.ab-btn-secondary:hover {
    background: var(--ab-dark);
    color: var(--ab-base);
}

@keyframes abPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .ab-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border: none;
        box-shadow: none;
    }

    .ab-form {
        padding: 1.25rem;
    }

    .ab-fields-grid {
        grid-template-columns: 1fr;
    }

    .ab-cal-day {
        font-size: 0.8rem;
    }

    .ab-cal-badge {
        font-size: 0.5rem;
    }
}