/* Reset Básico y Estilos Globales */
:root {
    --primary-color: #d9534f; /* Un rojo festivo */
    --secondary-color: hsl(41, 100%, 63%); /* Un crema cálido */
    --text-color: #333;
    --header-font: 'Lobster', cursive;
    --body-font: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth; /* Desplazamiento suave para los enlaces de ancla */
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* Encabezado */
.site-header {
    background-color: var(--primary-color);
    color: black;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.site-header h1 {
    font-family: var(--header-font);
    font-size: 2rem;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-icon {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: block; /* Siempre visible en móviles */
}

/* Menú de Navegación */
.main-nav {
    position: fixed;
    top: 0;
    right: -300px; /* Comienza fuera de la pantalla */
    width: 250px;
    height: 100%;
    background-color: #333;
    padding-top: 60px;
    transition: right 0.3s ease-in-out;
    z-index: 999;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
}

.main-nav.visible {
    right: 0; /* Se desliza para aparecer */
}

.main-nav ul {
    list-style: none;
}

.main-nav ul li a {
    display: block;
    color: black;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    transition: background-color 0.2s;
}

.main-nav ul li a:hover {
    background-color: var(--primary-color);
}

/* Contenido Principal */
main {
    padding: 2rem;
}

.content-section {
    background-color: white;
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-section h2 {
    font-family: var(--header-font);
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Estilo para los enlaces dentro de los títulos de sección */
.content-section h2 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease-in-out;
}



/* Diseño Responsivo */
@media (min-width: 768px) {
    .menu-icon {
        display: none; /* Oculta el ícono de hamburguesa en escritorio */
    }

    .main-nav {
        position: static; /* Restablece la posición */
        width: auto;
        height: auto;
        background: none;
        padding-top: 0;
        box-shadow: none;
        transition: none;
        display: flex; /* Muestra los enlaces en línea */
    }

    .main-nav ul {
        display: flex;
    }

    .main-nav ul li a {
        color: black;
        padding: 0.5rem 1rem;
        border-radius: 5px;
    }
    
    .main-nav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* Estilo para el enlace activo en la navegación */
.main-nav a.active {
    font-weight: bold;
    text-decoration: underline;
}

/* Estilo para que el título del header sea un enlace */
.header-link {
    text-decoration: none;
    color: inherit;
}

/* Estilos para la página de menú de comida */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.menu-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.menu-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.menu-item-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.menu-item-body h3 {
    font-family: var(--header-font);
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.menu-item-body p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.price {
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
    text-align: right;
    margin-top: auto; /* Empuja el precio al final */
}

/* Estilos para el footer de los items del menú */
.menu-item-footer {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.quantity-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.schedule-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-grow: 1;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    flex-grow: 1;
}

.add-to-cart-btn:hover {
    background-color: #c9302c; /* Un rojo más oscuro */
}

/* Estilos del Carrito */
.cart-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #333;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.cart-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%; /* Empieza fuera de la pantalla */
    width: 90%;
    max-width: 400px;
    height: 100%;
    background-color: white;
    z-index: 2000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.visible {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-header h2 {
    margin: 0;
    font-family: var(--header-font);
    color: var(--primary-color);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-info h4 {
    margin: 0 0 0.25rem 0;
}

.remove-item-btn {
    color: var(--primary-color);
    background: none;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-weight: bold;
}

.cart-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
}

/* Estilos para el pie de página principal */
.site-footer-main {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background-color: #333;
    color: var(--secondary-color);
}
.site-footer-main a {
    color: white;
}

/* Estilos para el Modal de Checkout */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}

.modal-content h3 {
    font-family: var(--header-font);
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Re-using form-group styles for checkout modal */
.modal-content .form-group {
    margin-bottom: 1rem;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.modal-content .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.submit-order-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.submit-order-btn:hover {
    background-color: #c9302c;
}
