:root {
    --dominant-color: #B92117;
    --dominant-text: #FFFFFF;
    --yellow: #D4AC0D;
    --orange: #D35400;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --dark-gray: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.order-section {
    padding: 30px 20px;
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.order-section h2 {
    color: var(--dominant-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--dark-gray);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--dominant-color);
    box-shadow: 0 0 0 2px rgba(185, 33, 23, 0.2);
}

#map {
    height: 300px;
    width: 100%;
    margin-top: 10px;
    border-radius: 5px;
}

.total-display {
    font-size: 20px;
    font-weight: 600;
    color: var(--yellow);
    margin-top: 20px;
    text-align: right;
}

/* Estilos genéricos para los botones de pago */
.payment-btn {
    background-color: var(--dominant-color);
    color: var(--white);
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-btn:hover {
    background-color: var(--orange);
}

.payment-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.payment-btn i {
    font-size: 18px;
}

#wallet_container {
    margin-top: 20px;
    width: 100%;
    min-height: 60px;
}

#wallet_container[data-loaded="false"] {
    display: none;
}

#wallet_container > div[disabled],
#wallet_container > button[disabled] {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

/* * NUEVOS ESTILOS PARA EL BOTÓN DE MERCADO PAGO 
 */
.payment-btn.mp-btn {
    background: linear-gradient(to right, #ffe600, #ffb300); /* Colores de Mercado Pago */
    color: #333333;
    box-shadow: 0 4px 10px rgba(255, 179, 0, 0.4);
    border: 1px solid #ffb300;
}

.payment-btn.mp-btn:hover {
    background: linear-gradient(to right, #ffb300, #ff9900); /* Efecto hover */
    box-shadow: 0 6px 15px rgba(255, 179, 0, 0.6);
}

.payment-btn.mp-btn i {
    color: #333333;
}

.payment-btn.mp-btn:disabled {
    background: #ccc;
    color: #666;
    border: none;
    box-shadow: none;
}


.delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
}

.delivery-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--dominant-color);
    border-radius: 5px;
    outline: none;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.delivery-option input[type="checkbox"]:checked {
    background-color: var(--dominant-color);
}

.delivery-option input[type="checkbox"]:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    position: absolute;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.delivery-option label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 16px;
}

.delivery-fields {
    display: none;
}

.alert-banner.error {
    max-width: 720px;
    margin: 12px auto;
    padding: 14px 18px;
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    font-weight: 500;
}

.shipping-hint {
    font-size: 14px;
    color: #555;
    margin: -8px 0 16px;
    line-height: 1.4;
}

.shipping-hint.free {
    color: #2e7d32;
    font-weight: 600;
}

.shipping-hint.paid {
    color: #d35400;
}

.total-breakdown {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.total-breakdown .line-total {
    margin: 0 0 8px;
    font-size: 15px;
}

.total-breakdown .total-display {
    margin: 12px 0 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--dominant-color, #B92117);
}

.pickup-message {
    display: none;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.pickup-map {
    width: 100%;
    height: 300px;
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.search-group input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
}

.search-group button {
    background-color: var(--dominant-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.search-group button:hover {
    background-color: var(--orange);
}

.search-group button i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .order-section {
        margin-top: 20px;
        padding: 20px 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
    }

    .total-display {
        font-size: 18px;
    }

    .payment-btn {
        padding: 15px 20px;
        font-size: 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-row .form-group {
        flex: unset;
    }
}

@media (min-width: 769px) {
    .form-row {
        display: flex;
        gap: 20px;
    }

    .form-row .form-group {
        flex: 1;
    }

    .payment-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }

    .payment-buttons .payment-btn,
    .payment-buttons #wallet_container {
        flex: 1;
        min-width: 250px;
    }
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: #28a745;
}

.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #dc3545;
}

.validation-message {
    font-size: 14px;
    color: #dc3545;
    margin-top: 5px;
    display: none;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
}

.loader {
    width: 48px;
    height: 48px;
    display: block;
    box-sizing: border-box;
    position: relative;
}

.loader::after {
    content: '';
    width: 48px;
    height: 48px;
    left: 0;
    bottom: 0;
    position: absolute;
    border-radius: 50% 50% 0;
    border: 15px solid red;
    transform: rotate(45deg) translate(0, 0);
    box-sizing: border-box;
    animation: animMarker 0.4s ease-in-out infinite alternate;
}

.loader::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    top: 150%;
    width: 24px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    animation: animShadow 0.4s ease-in-out infinite alternate;
}

@keyframes animMarker {
    0% {
        transform: rotate(45deg) translate(5px, 5px);
    }
    100% {
        transform: rotate(45deg) translate(-5px, -5px);
    }
}

@keyframes animShadow {
    0% {
        transform: scale(0.5);
    }
    100% {
        transform: scale(1);
    }
}
/* ================== Botón de Regreso (Ajuste de Posición) ================== */
.back-to-menu-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--dominant-color);
    color: #fff;
    width: 100px;
    height: 50px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    padding: 10px 15px; /* Relleno para que parezca un botón */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.back-to-menu-btn:hover {
    transform: scale(1.1);
    background-color: var(--orange);
}

/* --- ESTILOS PARA EL INTERRUPTOR DE SERVICIO A DOMICILIO --- */

/* Contenedor principal del interruptor */
#deliveryOptionContainer .form-check.form-switch {
    display: flex;
    align-items: center;
    padding-left: 0; /* Reseteamos padding para control manual */
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#deliveryOptionContainer .form-check.form-switch:hover {
    background-color: #f1f3f5;
}

/* Estilo del interruptor (la bolita) */
#deliveryOptionContainer .form-check-input {
    height: 1.5em;
    width: 2.75em;
    margin-left: 0;
    margin-right: 15px; /* Espacio entre el switch y el texto */
    background-color: #ced4da;
    border-color: #ced4da;
    cursor: pointer;
}

/* Estilo del interruptor cuando está activado */
#deliveryOptionContainer .form-check-input:checked {
    background-color: #ff8c00; /* Color naranja distintivo */
    border-color: #ff8c00;
}

/* Estilo del texto al lado del interruptor */
#deliveryOptionContainer .form-check-label {
    font-weight: 500;
    color: #343a40;
    cursor: pointer;
}

#deliveryOptionContainer .form-check-label i {
    margin-right: 8px; /* Espacio entre el icono y el texto */
    color: #495057;
}