* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', 'Arial', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
}

/* Add these responsive styles to your existing CSS */

/* Base responsive container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive booking container */
.booking-container {
    padding: 20px;
    margin-bottom: 30px;
}

/* Responsive form container */
.form-container {
    position: relative;
    z-index: 1;
}

/* Responsive map */
#map {
    height: 100%;
    width: 100%;
}

.map-container {
    height: 400px;
    width: 100%;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 0;
}

/* Responsive vehicle items */
.vehicle-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Responsive ride type toggle */
.ride-type-toggle {
    display: flex;
    margin-bottom: 16px;
    width: 100%;
}

/* Enhanced media queries */
@media (max-width: 1200px) {
    .booking-container {
        padding: 20px;
    }
    
    #map {
        height: 500px;
    }
}

@media (max-width: 992px) {
    .booking-container {
        flex-direction: column;
        padding: 16px;
        position: relative;
    }
    
    .form-container {
        width: 100%;
    }
    
    #map {
        width: 100%;
        height: 400px;
        min-width: unset;
    }
    
    .quote-view .form-container {
        flex-direction: column;
    }
    
    .quote-view .booking-form-section,
    .quote-view .vehicle-options-section {
        width: 100%;
    }
    
    .vehicle-options-section {
        border-left: none !important;
        border-top: 1px solid #e0e0e0;
        padding-top: 20px;
        margin-top: 20px;
        padding-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .booking-container {
        padding: 12px;
        border-radius: 12px;
    }
    
    #map {
        height: 350px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input {
        padding: 10px 14px;
    }
    
    .btn-book, .btn-confirm {
        padding: 12px 16px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .form-container h2 {
        font-size: 1.2rem;
    }
    
    .vehicle-item {
        padding: 12px;
    }
    
    .vehicle-icon {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }
    
    .vehicle-name {
        font-size: 0.9rem;
    }
    
    .vehicle-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .booking-container {
        padding: 10px;
        border-radius: 10px;
    }
    
    #map {
        height: 300px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .form-container {
        padding: 16px;
    }
    
    .form-container h2 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input {
        font-size: 0.9rem;
    }
    
    .vehicle-item {
        flex-wrap: wrap;
    }
    
    .vehicle-price {
        width: 100%;
        text-align: right;
        margin-top: 8px;
    }
    
    /* Fix map container in quote view */
    #map-container {
        width: 100% !important;
        margin-top: 16px !important;
    }
}

header {
    text-align: left;
    margin-bottom: 20px;
}

header h1 {
    color: #222;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Add these styles for the layout change */

/* Updating the quote view layout to show map instead of route instructions */

.booking-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 24px;
    transition: all 0.3s ease;
}

/* Default layout: side by side */
.booking-container.default-view {
    flex-direction: row;
}

/* Quote view: form and vehicle options side by side, map below */
.booking-container.quote-view {
    flex-direction: column;
}

.quote-view .form-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.quote-view .booking-form-section,
.quote-view .vehicle-options-section {
    width: 100%;
}

.quote-view .vehicle-options-section {
    margin-bottom: 0;
}

.quote-view #map {
    width: 100%;
    height: 400px;
    order: 3;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 24px;
}

/* Hide route details panel in quote view */
.route-details-panel {
    display: none;
}

.quote-view .route-details-panel {
    display: none;
}

/* Information section styling */
.info-section {
    margin-bottom: 20px;
}

.info-section h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Make vehicle items more compact */
.vehicle-item {
    padding: 12px;
    margin-bottom: 8px;
}

/* Adjust media queries for responsive layout */
@media (max-width: 992px) {
    .quote-view .form-container {
        flex-direction: column;
    }
    
    .quote-view .booking-form-section,
    .quote-view .vehicle-options-section {
        width: 100%;
    }
}

.quote-view .route-details-panel {
    display: block;
}

.route-instruction {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.route-instruction:last-child {
    border-bottom: none;
}

.instruction-icon {
    margin-right: 15px;
    font-size: 1.2rem;
}

.instruction-text {
    flex: 1;
}

.instruction-distance {
    color: #666;
    font-size: 0.9rem;
}

.form-container {
    flex: 1;
    min-width: 320px;
    background-color: white;
    padding: 24px;
    border-radius: 0;
    box-shadow: none;
}

.form-container h2 {
    margin-bottom: 24px;
    color: #222;
    font-size: 1.4rem;
    font-weight: 600;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.autocomplete-container {
    position: absolute;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item:hover {
    background-color: #f5f8ff;
}

.autocomplete-item.no-results {
    color: #999;
    font-style: italic;
    cursor: default;
}

/* Vehicle selection styles */
.vehicle-options {
    margin: 24px 0;
}

.vehicle-options h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 500;
}

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.vehicle-item:hover {
    border-color: #2196F3;
    background-color: #f5f8ff;
}

.vehicle-item.selected {
    border-color: #2196F3;
    background-color: #f5f8ff;
}

.vehicle-icon {
    width: 48px;
    height: 48px;
    margin-right: 16px;
}

.vehicle-details {
    flex: 1;
}

.vehicle-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.vehicle-description {
    font-size: 0.85rem;
    color: #666;
}

.vehicle-price {
    font-weight: 600;
    color: #222;
}

.btn-book, .btn-confirm {
    background-color: #FFA500;
    color: white;
    border: none;
    padding: 14px 20px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-book:hover, .btn-confirm:hover {
    background-color: #F09000;
}

.btn-confirm {
    background-color: #FFA500;
    margin-top: 16px;
}

.btn-confirm:hover {
    background-color: #F09000;
}

#map {
    width: 100%;
    height: 250px;
    margin-top: 20px;
}

#booking-info {
    margin-top: 24px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#booking-info h3 {
    margin-bottom: 16px;
    color: #222;
    font-size: 1.1rem;
    font-weight: 600;
}

.price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.price-label {
    font-size: 1.1rem;
    font-weight: 500;
}

.price-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #222;
}

.hidden {
    display: none;
}

/* Business/Economy toggle */
.ride-type-toggle {
    display: flex;
    margin-bottom: 16px;
}

.ride-type-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    background-color: #f5f5f5;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.ride-type-option:first-child {
    border-radius: 8px 0 0 8px;
}

.ride-type-option:last-child {
    border-radius: 0 8px 8px 0;
}

.ride-type-option.selected {
    background-color: #2196F3;
    color: white;
}

@media (max-width: 992px) {
    .booking-container {
        flex-direction: column-reverse;
    }
    
    #map {
        height: 400px;
        border-radius: 16px 16px 0 0;
    }
    
    .form-container {
        border-radius: 0 0 16px 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    #map {
        height: 300px;
    }
}


/* Improved mobile responsiveness for map and quotes */

/* Fix map visibility on mobile and quote display issues */

/* Ensure map is visible on mobile with high z-index */
@media (max-width: 768px) {
    #map {
        width: 100% !important;
        height: 250px !important;
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 1 !important;
        margin: 20px 0 100px 0 !important;
        border-radius: 8px;
        overflow: visible;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        min-height: 180px;
    }
    
    /* Fix the booking container layout */
    .booking-container {
        flex-direction: column !important;
        padding: 12px;
        overflow: visible !important;
    }
    
    /* Ensure form container is properly sized */
    .form-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix vehicle items to prevent text overflow */
    .vehicle-item {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        grid-template-areas: 
            "icon name price"
            "icon desc desc" !important;
        align-items: start !important;
        gap: 8px !important;
        padding: 12px !important;
        margin-bottom: 10px !important;
    }
    
    .vehicle-icon {
        grid-area: icon !important;
        font-size: 20px !important;
        margin-right: 0 !important;
    }
    
    .vehicle-details {
        grid-area: name / name / desc / desc !important;
        min-width: 0 !important;
    }
    
    .vehicle-name {
        font-weight: 600 !important;
        margin-bottom: 4px !important;
        white-space: normal !important;
    }
    
    .vehicle-description {
        font-size: 0.85rem !important;
        color: #666 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    .vehicle-price {
        grid-area: price !important;
        margin-left: 0 !important;
        font-weight: 600 !important;
    }
    
    /* Fix quote view layout */
    .quote-view .booking-form-section {
        display: none !important;
    }
    
    .quote-view .vehicle-options-section {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* Ensure the map container is visible */
    #map-container {
        width: 100% !important;
        height: 300px !important;
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 999 !important;
    }
}

/* Extra small devices - further optimize for very small screens */
@media (max-width: 480px) {
    #map {
        height: 250px !important;
    }
    
    /* Make sure the ride type toggle is properly sized */
    .ride-type-toggle {
        margin: 15px 0 !important;
    }
    
    .ride-type-option {
        padding: 10px 8px !important;
        font-size: 0.9rem !important;
    }
    
    /* Ensure price summary is properly displayed */
    .price-summary {
        margin: 15px 0 !important;
        padding: 12px !important;
    }
}


/* Add these styles for the loader */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 165, 0, 0.3);
    border-radius: 50%;
    border-top-color: #FFA500;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Make sure buttons have position relative for loader positioning */
.btn-book, .btn-confirm {
    position: relative;
}

/* Add disabled button styles */
.btn-book:disabled, .btn-confirm:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.booking-form-section,
.vehicle-options-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#initial-map-container {
    height: 100%;
    min-height: 400px;
}

.vehicle-options-section.show {
    display: block !important;
}

#final-map-position.show {
    display: block !important;
}

.btn-back {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.btn-back:hover {
    background-color: #e0e0e0;
}

/* Ajustes para el contenedor del mapa */
#initial-map-container {
    height: 100%;
    min-height: 400px;
}

.map-container {
    height: 400px;
    width: 100%;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 0;
}

/* Ajustes responsive */
@media (max-width: 992px) {
    /* Reorganizar el orden de los elementos en mobile */
    .booking-form-section {
        order: 1;
    }

    .vehicle-options-section {
        order: 2;
        margin-top: 20px;
    }

    #initial-map-container {
        order: 3;
        min-height: 300px;
        margin-top: 20px;
    }

    .map-container {
        height: 300px;
    }

    /* Ajustar el espacio entre elementos */
    .row.g-4 {
        --bs-gutter-y: 1rem;
    }

    /* Asegurar que el mapa no se superponga */
    #final-map-position {
        margin-top: 2rem !important;
        order: 3;
    }

    /* Forzar el orden de los elementos */
    .col-lg-6 {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    /* Mantener el orden en pantallas más pequeñas */
    .booking-container {
        display: flex;
        flex-direction: column;
    }

    .form-container {
        display: flex;
        flex-direction: column;
    }

    .row.g-4 {
        display: flex;
        flex-direction: column;
    }

    .col-lg-6 {
        width: 100%;
    }

    #initial-map-container {
        min-height: 250px;
        order: 3;
    }

    .map-container {
        height: 250px;
    }

    .booking-form-section {
        order: 1;
    }

    .vehicle-options-section {
        order: 2;
    }
}

@media (max-width: 576px) {
    #initial-map-container {
        min-height: 200px;
    }

    .map-container {
        height: 200px;
    }

    /* Ajustar layout para pantallas muy pequeñas */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 10px;
    }

    .btn-back {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Mejorar la visualización de la información */
    .vehicle-options-section p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .price-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Estilos para el formulario de pago */
#payment-form-container {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

#payment-form {
    width: 100%;
}

#payment-element {
    margin-bottom: 24px;
}

.payment-message {
    color: rgb(105, 115, 134);
    font-size: 16px;
    line-height: 20px;
    padding-top: 12px;
    text-align: center;
}

.payment-message.error {
    color: #dc3545;
}

/* Estilos para el spinner de carga */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.spinner.hidden {
    display: none;
}