/* =========================================
   Variables Globales y Reset
   ========================================= */
:root {
    --primary-color: #0056b3; /* Azul tecnológico */
    --secondary-color: #ff6b00; /* Naranja para los botones de acción */
    --text-color: #333333;
    --bg-color: #f4f4f9;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* =========================================
   Encabezado y Navegación (Flexbox)
   ========================================= */
.header {
    background-color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-text {
    font-size: 1.8rem;
    color: var(--text-color);
}

.logo-text span {
    color: var(--primary-color);
}

/* Truco del Menú Móvil sin JavaScript */
.menu-toggle {
    display: none;
}

.menu-icon {
    font-size: 2rem;
    cursor: pointer;
    display: none; /* Oculto en computadoras */
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.btn-cart {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.btn-cart:hover {
    background-color: #004494;
}

/* =========================================
   Sección Hero (Banner Principal)
   ========================================= */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-color), #00a2ff);
    color: var(--white);
    text-align: center;
    padding: 5rem 2rem;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 0.8rem 2.5rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #e65c00;
}

/* =========================================
   Productos Destacados (CSS Grid)
   ========================================= */
.destacados {
    padding: 4rem 5%;
    text-align: center;
}

.destacados h2 {
    margin-bottom: 3rem;
    font-size: 2rem;
}

.grid-productos-destacados {
    display: grid;
    /* Esto hace que las columnas se adapten automáticamente al tamaño de la pantalla */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card-producto {
    background-color: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.card-producto:hover {
    transform: translateY(-5px);
}

/* Espacio temporal para las fotos de los productos */
.img-placeholder {
    background-color: #eaeaea;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-bottom: 1rem;
    color: #888;
    font-weight: bold;
}

.card-producto h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.precio {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    margin: 1rem 0;
}

.btn-secondary {
    display: block;
    background-color: var(--text-color);
    color: var(--white);
    text-decoration: none;
    padding: 0.8rem;
    border-radius: 5px;
    font-weight: bold;
}

.btn-secondary:hover {
    background-color: #555;
}

/* =========================================
   Pie de Página
   ========================================= */
.footer {
    background-color: #222;
    color: var(--white);
    padding: 3rem 5% 1rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #444;
    font-size: 0.9rem;
    color: #888;
}

/* =========================================
   Diseño Responsivo (Celulares y Tablets)
   ========================================= */
@media (max-width: 768px) {
    .menu-icon {
        display: block; /* Mostramos el icono de hamburguesa */
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        max-height: 0; /* Oculto por defecto */
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .nav-menu ul {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 1.2rem;
        border-bottom: 1px solid #eee;
    }

    .btn-cart {
        margin: 1rem auto;
        display: inline-block;
        width: 80%;
    }

    /* MAGIA: Cuando el checkbox está seleccionado, el menú crece y se muestra */
    #menu-toggle:checked ~ .nav-menu {
        max-height: 400px; 
    }

    .hero-content h2 {
        font-size: 2rem;
    }
}
/* =========================================
   Página: Nosotros
   ========================================= */
.page-header {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 3rem 2rem;
}

.page-header h2 {
    font-size: 2.5rem;
}

.nosotros-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    padding: 4rem 5%;
    align-items: center;
}

.nosotros-texto {
    flex: 1;
    min-width: 300px; /* Evita que se aplaste en celulares */
}

.nosotros-texto h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.nosotros-texto p {
    margin-bottom: 1rem;
    text-align: justify;
}

.nosotros-imagen {
    flex: 1;
    min-width: 300px;
}

.img-placeholder-large {
    background-color: #eaeaea;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #888;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
/* =========================================
   Página: Productos (Catálogo e Imágenes)
   ========================================= */
.catalogo-section {
    padding: 4rem 5%;
}

.grid-catalogo {
    display: grid;
    /* Crea columnas automáticas que se adaptan al tamaño de la pantalla */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Estilos para las imágenes reales de los productos */
.img-producto {
    width: 100%;
    height: 200px;
    object-fit: cover; /* Hace que la imagen llene el espacio sin deformarse */
    border-radius: 5px;
    margin-bottom: 1rem;
    background-color: #fff;
}
/* =========================================
   Página: Contacto
   ========================================= */
.contacto-section {
    padding: 4rem 5%;
}

.contacto-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 4rem;
}

.info-contacto {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.info-contacto h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.info-contacto p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.formulario-contacto {
    flex: 2;
    min-width: 300px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.formulario-contacto h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 86, 179, 0.3);
}

.mapa-container {
    text-align: center;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.mapa-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}
/* =========================================
   Página: Carrito de Compras
   ========================================= */
.carrito-section {
    padding: 4rem 5%;
}

.carrito-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

/* Lista de items (ocupa más espacio) */
.carrito-items {
    flex: 2;
    min-width: 300px;
}

.item-carrito {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.img-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #eee;
}

.info-item {
    flex: 2;
    min-width: 150px;
}

.info-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.info-item p {
    font-size: 0.9rem;
    color: #666;
}

.cantidad-item input {
    width: 50px;
    padding: 0.3rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.precio-item {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Resumen del pedido (ocupa menos espacio) */
.carrito-resumen {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: fit-content;
}

.carrito-resumen h3 {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 1rem;
}

.resumen-fila {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.linea-divisoria {
    border: 0;
    border-top: 1px solid #eee;
    margin: 1.5rem 0;
}

.resumen-fila.total {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.text-center {
    text-align: center;
}