/* --- RESET Y CONFIGURACIÓN GENERAL --- */
:root {
    --primary-color: #ff5722;
    --primary-dark: #e64a19;
    --light-gray: #f4f4f9;
    --text-color: #333;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--light-gray);
    color: var(--text-color);
    touch-action: manipulation;
    padding: 20px;
}

.main-content-wrapper {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- ELEMENTOS PRINCIPALES --- */
h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
}

.logo-principal {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-principal img {
    max-width: 180px;
    height: auto;
}

.info-text {
    color: #d32f2f !important;
    font-size: 11px;
    text-align: center;
    margin-top: 8px;
    padding: 0 10px;
}

#total-general {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin: 20px 0;
}

/* --- FORMULARIO Y CONTROLES --- */
select, input[type="text"], input[type="tel"], textarea {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    font-size: 16px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus, input[type="text"]:focus, input[type="tel"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.2);
}

#nota-general-container {
    margin: 20px 0;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.metodo-pago {
    margin: 20px 0;
    text-align: center;
}

.subtitulo-pago {
    font-weight: bold;
    margin-bottom: 12px;
}

.opciones-pago {
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: center;
}

.opciones-pago label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

button, .btn-wsp {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover, .btn-wsp:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

/* Spinner para el botón de envío */
button[type="submit"].is-loading .button-text {
    visibility: hidden;
}

button[type="submit"].is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 3px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

/* --- TARJETAS DE MENÚ --- */
#menus-container {
    display: grid;
    gap: 20px;
}

.menu {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.menu:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.menu h2 {
    margin-bottom: 15px;
    font-size: 1.4em;
}

.menu img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    object-fit: cover;
}

.menu p {
    margin-bottom: 15px;
    flex-grow: 1; /* Empuja el control de cantidad hacia abajo */
}

.precio-menu {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-dark);
}

.cantidad-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: auto;
}

.cantidad-control button {
    font-size: 20px;
    width: 40px;
    height: 40px;
    padding: 0;
}

.cantidad-control span {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 40px;
}

/* --- ELEMENTOS FLOTANTES --- */
.marca-powered {
    position: fixed;
    top: 10px;
    right: 15px;
    z-index: 1001;
}

.marca-powered img {
    height: 18px;
    opacity: 0.8;
}

.floating-cart {
    position: fixed;
    top: 40px;
    right: 15px;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 14px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 18px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s;
}

/* --- MODALES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-content h2 { margin-bottom: 15px; }
.modal-content p { margin-bottom: 10px; }
.modal-content .mensaje-comprobante { font-weight: bold; color: #d32f2f; margin-top: 20px; }
.modal-content .btn-wsp { margin-top: 15px; }
.modal-content button { margin: 10px 5px 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- DISEÑO RESPONSIVO (ESCRITORIO) --- */
@media (min-width: 768px) {
    .main-content-wrapper {
        /* Aumentamos un poco el ancho para más comodidad */
        max-width: 1000px; 
    }
    #menus-container {
        /* Forzamos 3 columnas de igual tamaño (1fr cada una) */
        grid-template-columns: repeat(3, 1fr);
    }
}