/*=======================================================================================*/
/* 💡 REGLAS BASE Y RESETEO */
/*=======================================================================================*/
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Evita que las imágenes se salgan del contenedor */
.img-fluid {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* CORRECCIÓN: Espaciado del título principal */
h3 {
    padding: 1.5rem 1rem 0.5rem; /* Aumento el padding superior e inferior */
    margin: 0;
}

/*=======================================================================================*/
/* 🌟 DISEÑO DEL ENCABEZADO Y TEXTO PROMOCIONAL */
/*=======================================================================================*/
.header-principal {
    position: relative;
    background-color: white;
    width: 100%;
}

/* Contenedor del texto promocional */
.header-texto {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    text-align: right;
    z-index: 10;
}

.header-texto h1 {
    font-size: 2.5rem;
    margin: 0;
    line-height: 1;
    color: black;
    font-weight: bold;
}

.header-texto h2 {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1;
    color: #f35b04; 
    font-weight: normal;
}

/*=======================================================================================*/
/* 🔗 BARRA DE NAVEGACIÓN (FUNCIONALIDAD DE FLEXBOX Y BOTÓN) */
/*=======================================================================================*/

/* Botón de hamburguesa: Oculto por defecto en escritorio, aparece en móvil */
.menu-toggle {
    display: none; /* Oculto por defecto */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: black;
    padding: 0;
    line-height: 1;
}

/* El menú colapsable en escritorio se alinea a la derecha */
.nav-links-iconos {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    transition: transform 0.3s ease-in-out; /* Transición para la animación */
}
.navegacion-principal {
    background-color: transparent;
    padding: 0.5rem 0;
    display: flex; 
    justify-content: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 1rem;
    display: flex; 
    justify-content: flex-end; 
}

/* Oculta los elementos extra de texto/menú rotos */
.nav-container > div:first-child { 
    display: none; 
}

.nav-links-iconos {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.nav-link i {
    font-size: 1.5rem;
    color: black;
    text-shadow: 1px 1px 2px rgba(128, 128, 128, 0.5);
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.nav-link i:hover {
    transform: scale(1.1);
    color: #555;
}

/*=======================================================================================*/
/* 📦 TARJETAS DE ARTÍCULOS (Uniformidad de Altura y Jerarquía) */
/*=======================================================================================*/

.tarjetas-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    margin-bottom: 70px; 
}

/* Tarjeta: Contenedor principal de Flexbox */
.tarjeta {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
    background-color: white;
    display: flex; 
    flex-direction: column;
}

.tarjeta-img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: contain; 
}

/* Cuerpo de la tarjeta: Flexbox para alinear elementos */
.tarjeta-body-flex {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

/* Contenido superior: Ocupa el espacio restante */
.tarjeta-content-top {
    flex-grow: 1; 
    /* CORRECCIÓN CLAVE: Forzar altura mínima para alinear Precio/Stock */
    min-height: 70px; 
}

/* Contenido inferior: Se ancla al final */
.tarjeta-content-bottom {
    margin-top: auto; 
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

/* Estilos de Tipografía */
.tarjeta-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: #333;
}

/* Restaurado el estilo de cursiva */
.tarjeta-text {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    font-style: italic; 
}

/* Jerarquía visual para Leer más */
.leer-mas-link-container {
    margin-bottom: 0.75rem;
}
.leer-mas-link {
    color: #f35b04;
    text-decoration: none;
    font-weight: bold; 
    font-size: 1.05rem; 
}
.leer-mas-link:hover {
    text-decoration: underline;
}

/* Jerarquía Precio y Stock */
.precio-stock-info {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* CORRECCIÓN: Mejorar la legibilidad del Stock (cambio a gris) */
.stock-info {
    font-size: 0.9rem;
    font-weight: normal;
    color: #6c757d; 
}

/* Formularios y Botones */
.form-carrito {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.form-group-flex {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.cantidad-label {
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: bold;
}
.cantidad-input {
    width: 60px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    border: 1px solid #ced4da;
    flex-grow: 0;
}

.btn-carrito {
    background-color: #f35b04 !important;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: background-color 0.2s ease-in-out;
    outline: none !important;
    width: 100%;
}

.btn-carrito:hover {
    background-color: #d84a02 !important;
}


/*=======================================================================================*/
/* 📱 MEDIA QUERIES (Responsividad) */
/*=======================================================================================*/

/* Pantallas medianas: de 768px a 1023px (2 tarjetas por fila) */
@media (min-width: 768px) and (max-width: 1023px) {
    .tarjetas-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .tarjeta {
        flex: 1 1 calc(50% - 1.5rem);
    }
}

/* Pantallas grandes: de 1024px en adelante (5 tarjetas por fila) */
@media (min-width: 1024px) {
    .tarjetas-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .tarjeta {
        /* Permite 5 columnas con espaciado */
        flex: 1 1 calc(20% - 1.2rem); 
    }
    .tarjeta-title {
        font-size: 1.3rem !important;
    }
    .tarjeta-text {
        font-size: 0.9rem !important;
    }
}

/*=======================================================================================*/
/* 🛒 CARRITO FLOTANTE Y OTROS BOTONES */
/*=======================================================================================*/

#botonCarrito {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #F35B04;
    color: white;
    padding: 1rem;
    border-radius: 50%;
    font-size: 1.25rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border: none;
    transition: background-color 0.2s ease-in-out;
}

#botonCarrito:hover {
    background-color: #d9480f;
}


/* (Estilos de listaCarrito, btn-primary, btn-warning se incluirían aquí) */


/*=======================================================================================*/
/* 🦶 FOOTER (VERSIÓN FINAL Y MEJORADA CON DOBLE TONO NARANJA) */
/*=======================================================================================*/

footer {
    /* Fondo principal: NARANJA SUAVE */
    background-color: #ff7a29; 
    color: #fff;
    padding: 2.5rem 0 0; 
    margin-top: 2rem;
}

.footer-content {
    /* El contenido utiliza el fondo suave del footer */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 1.5rem;
}

/* Encabezados y Contenido (Blancos sobre Naranja Suave) */
.footer-section h3 {
    color: #FFFFFF; 
    margin-bottom: 1rem; 
    font-size: 1.2rem;
}

.footer-section p,
.footer-section ul,
.footer-section a {
    color: #FFFFFF; 
    text-decoration: none;
    line-height: 1.6;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-section h4 {
    color: #000000;
    margin-top: 0.5rem;
    margin-bottom: 0;
    text-shadow: none; 
    font-size: 1rem !important;
    font-style: italic;
    font-weight: bold;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section a:hover {
    color: #000000; 
    text-decoration: underline;
}

.footer-section.social a {
    font-size: 2em; 
    margin-right: 0.75rem;
    color: #FFFFFF;
    transition: color 0.3s ease;
}

.footer-section.social a:hover {
    color: #000000; 
}

/* Copyright: NARANJA FUERTE */
.footer-bottom {
    /* Fondo del copyright: NARANJA MÁS FUERTE */
    background-color: #f35b04; 
    color: white;
    padding: 1rem 0; 
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.4); 
    font-size: 0.85rem;
}

/*=======================================================================================*/
/* 📱 MÓVIL (Menú Hamburguesa) */
/*=======================================================================================*/

@media (max-width: 767px) {
    /* 1. Mostrar el botón de hamburguesa */
    .menu-toggle {
        display: block; 
        position: absolute; /* Para que quede en la esquina superior */
        right: 1rem;
        top: 0.5rem;
        z-index: 20;
    }

    /* 2. El contenedor de navegación debe justificar espacio */
    .nav-container {
        justify-content: space-between; /* Alinea el logo a la izquierda y el botón a la derecha */
        position: relative; /* Necesario para posicionar el menú */
    }
    
    /* Ocultamos el texto duplicado de 'MENAJE' si vuelve a aparecer, aunque ya lo corregimos */
    .nav-container > div:first-child { 
        display: none; 
    }

    /* 3. El menú de enlaces se convierte en una lista vertical */
    .nav-links-iconos {
        /* Estado inicial: Oculto y fuera de la pantalla */
        display: flex; /* Mantenemos flex para la columna */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Justo debajo de la barra de navegación */
        left: 0;
        width: 100%;
        background-color: #eee; /* Fondo claro para que se vea el menú */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 10;
        
        /* CLAVE: Ocultar el menú por defecto */
        height: 0;
        overflow: hidden; /* Oculta el contenido desbordado */
    }

    /* 4. Estado activo del menú (activado por JavaScript) */
    .nav-links-iconos.active {
        /* Altura calculada: Ajusta este valor si necesitas más o menos espacio */
        height: 100px; 
        padding: 0.5rem 0;
    }

    /* 5. Estilo de los elementos del menú */
    .nav-links-iconos .nav-item {
        padding: 0.5rem 1rem;
        text-align: center;
    }
}