/**
 * Main Booking Form - Address Fields Layout Fix
 * Ensures labels appear ABOVE inputs (vertical layout)
 * Not side-by-side (horizontal layout)
 */

/* ============================================ */
/* ADDRESS FIELDS CONTAINER */
/* ============================================ */

.ctb-form-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
    margin-top: 20px !important;
    width: 100% !important;
}

/* Each address field column (Pickup / Dropoff) */
.ctb-form-col {
    display: flex !important;
    flex-direction: column !important;
    /* CRITICAL: Stack children vertically */
    flex: 1 !important;
    min-width: 0 !important;
}

.ctb-form-col-half {
    flex: 1 1 calc(50% - 10px) !important;
    max-width: calc(50% - 10px) !important;
}

/* ============================================ */
/* LABELS - Above inputs */
/* ============================================ */

.ctb-form-label {
    display: block !important;
    /* CRITICAL: Makes label full width */
    width: 100% !important;
    margin-bottom: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.5 !important;
}

.ctb-form-label i {
    margin-right: 6px !important;
    color: #ffc107 !important;
}

.ctb-form-label .text-danger {
    color: #dc3545 !important;
    margin-left: 3px !important;
}

/* ============================================ */
/* INPUT FIELDS - Below labels */
/* ============================================ */

.ctb-form-input {
    display: block !important;
    /* CRITICAL: Makes input full width */
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    background-color: #fff !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.ctb-form-input:focus {
    border-color: #ffc107 !important;
    outline: none !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25) !important;
}

.ctb-form-input::placeholder {
    color: #999 !important;
    font-weight: 400 !important;
}

.ctb-form-input:read-only,
.ctb-form-input[readonly] {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
    border-color: #ddd !important;
    font-style: italic !important;
}

/* ============================================ */
/* HELPER TEXT - Below inputs */
/* ============================================ */

.ctb-form-hint {
    display: block !important;
    margin-top: 6px !important;
    font-size: 12px !important;
    color: #666 !important;
    line-height: 1.4 !important;
}

.ctb-form-hint i {
    margin-right: 4px !important;
    font-size: 11px !important;
    color: #999 !important;
}

/* ============================================ */
/* ERROR MESSAGES */
/* ============================================ */

.ctb-error-message {
    display: none !important;
    margin-top: 6px !important;
    font-size: 13px !important;
    color: #dc3545 !important;
    font-weight: 500 !important;
}

.ctb-error-message.show {
    display: block !important;
}

.ctb-form-input.is-invalid {
    border-color: #dc3545 !important;
}

/* ============================================ */
/* MOBILE RESPONSIVE */
/* ============================================ */

@media (max-width: 767px) {
    .ctb-form-row {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .ctb-form-col-half {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }

    .ctb-form-input {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }

    .ctb-form-label {
        font-size: 13px !important;
    }
}

/* ============================================ */
/* TABLET */
/* ============================================ */

@media (min-width: 768px) and (max-width: 991px) {
    .ctb-form-col-half {
        flex: 1 1 calc(50% - 10px) !important;
    }
}

/* ============================================ */
/* DESKTOP */
/* ============================================ */

@media (min-width: 992px) {
    .ctb-form-row {
        gap: 24px !important;
    }

    .ctb-form-input {
        padding: 14px 18px !important;
    }
}

/* ============================================ */
/* CRITICAL FIX: Prevent inline layout */
/* ============================================ */

/* Force vertical stacking - override any conflicting styles */
.ctb-form-col>* {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure nothing creates inline layout */
.ctb-form-col label+input {
    margin-top: 0 !important;
    /* Input comes after label vertically */
}

/* No flexbox row layouts within columns */
.ctb-form-col {
    flex-direction: column !important;
    /* Force column direction */
}

/* Disable any grid that might cause horizontal layout */
.ctb-form-col {
    display: flex !important;
    grid-template-columns: none !important;
}

/* ============================================ */
/* BOOTSTRAP OVERRIDES (if needed) */
/* ============================================ */

/* Override Bootstrap's form-control if it's applied */
.ctb-form-input.form-control {
    display: block !important;
    width: 100% !important;
}

/* Override any Bootstrap row behavior on form-row */
.ctb-form-row.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override Bootstrap col behavior */
.ctb-form-col.col,
.ctb-form-col[class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

.ctb-form-label:focus-within {
    color: #000 !important;
}

.ctb-form-input:focus {
    border-width: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ctb-form-input {
        border-width: 3px !important;
    }
}


/* ============================================ */
/* ROUTE MAP STYLING */
/* ============================================ */

#route-map {
    background: #e5e3df;
    position: relative;
}

/* Map info cards */
#route-map + .row .card {
    transition: all 0.3s ease;
}

#route-map + .row .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Distance and duration text */
#map-distance,
#map-duration {
    color: #1a1a1a;
    font-size: 1.25rem;
}

/* Responsive map height */
@media (max-width: 991px) {
    #route-map {
        height: 350px !important;
    }
}

@media (max-width: 767px) {
    #route-map {
        height: 300px !important;
    }
}

/* Smooth transition for sidebar visibility */
#summary-sidebar,
#main-form-area {
    transition: all 0.3s ease;
}