
:root {
    --bg-navbar: #e0e0e0; 
    --text-color: #333333;
    --accent-color: #0b7a99; /* Azul de tu logo */
    --date-color: #666666;
    --nav-height:100px;
}

html {
    scroll-behavior: smooth; /* Desplazamiento suave para los enlaces con # */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff; /* Fondo blanco por defecto */
    margin: 0;
    padding: 0;
}
.nav-bar {
    background-color: var(--bg-navbar);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-imagen {
    height: 45px;
    width: auto;
    display: block;
    object-fit: contain;
}

.current-date {
    font-size: 0.85rem;
    color: var(--date-color);
    border-left: 1px solid #ddd;
    padding-left: 15px;
}

.nav-container ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 25px;
}

.nav-container ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-container ul li a:hover {
    color: var(--accent-color);
}

.nav-container ul li a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.nav-container ul li a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Header para celulares */
@media (max-width: 600px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 10px;
        gap: 15px;
    }
    .brand-section {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    .current-date {
        border-left: none;
        padding-left: 0;
    }
    .nav-container ul {
        gap: 20px;
    }
}

/* =========================================
   SECCIÓN 1: HERO (Imagen de fondo en el Index)
   ========================================= */
.hero-section {
    /* NOTA: Asegúrate de poner tu imagen de fondo real en la url() */
    background-image: linear-gradient(rgba(0, 10, 30, 0.7), rgba(0, 10, 30, 0.7)), url('../imagenes/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 70vh;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.hero-divider {
    width: 60%;
    margin: 15px auto;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
}

/* =========================================
   SECCIÓN 2: INFORMACIÓN Y BOTÓN (Index)
   ========================================= */
.info-section {
    background-color: #ffffff;
    padding: 80px 20px;
    text-align: center;
}

.info-container {
    max-width: 800px;
    margin: 0 auto;
}

.info-title {
    color: #127c94;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 30px;
}

.info-text {
    color: #666666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    background-color: #0b7a99;
    color: #ffffff;
    padding: 12px 30px;
    margin-top: 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #085e77;
}

.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid #0b7a99;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: #0b7a99;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-top: 0;
}

.product-info h4 {
    margin: 0 0 10px 0;
    color: #333333;
    font-size: 1.2rem;
}

.product-desc {
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-section {
    background-color: #f4f7f6;
    padding: 60px 20px;
    text-align: center;
    overflow: hidden;
}

.products-title {
    color: #127c94;
    font-size: 2rem;
    margin-bottom: 40px;
}

.carousel-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scroll-carrusel 30s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

/* Forzamos el ancho de la tarjeta solo dentro del carrusel */
.carousel-track .product-card {
    flex: 0 0 300px;
}

@keyframes scroll-carrusel {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Botón Ver Más debajo del carrusel */
.ver-mas-container {
    max-width: 1200px;
    margin: 20px auto 0;
    text-align: right;
    padding: 0 20px;
}

.btn-ver-mas {
    display: inline-block;
    color: #0b7a99;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.btn-ver-mas:hover {
    color: #085e77;
    text-decoration: underline;
}

/* =========================================
   SECCIÓN 4: CATÁLOGO DE PRODUCTOS (Grid)
   ========================================= */
.catalogo-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60vh;
}

.filtros-container {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap; 
}

.filtros-container input, .filtros-container select {
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 250px;
    outline: none;
}

.filtros-container input:focus, .filtros-container select:focus {
    border-color: #0b7a99;
}

/* Cuadrícula Estricta de 4 columnas */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Asegura que la tarjeta use todo el espacio de su columna y no se estire */
.grid-productos .product-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Diseño Responsivo para la cuadrícula */
@media (max-width: 1024px) {
    .grid-productos {
        grid-template-columns: repeat(3, 1fr); /* 3 por renglón en tablets */
    }
}

@media (max-width: 768px) {
    .grid-productos {
        grid-template-columns: repeat(2, 1fr); /* 2 por renglón celulares grandes */
    }
}

@media (max-width: 480px) {
    .grid-productos {
        grid-template-columns: 1fr; /* 1 por renglón celulares pequeños */
    }
}

/* =========================================
   SECCIÓN 5: CONTACTO (Index)
   ========================================= */
.contact-section {
    background-color: #ffffff;
    padding: 40px 20px 80px;
}

.contact-container {
    max-width: 1000px;
    margin: 0 auto;
}

.contact-heading {
    text-align: left;
    color: #000000;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.contact-line {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 50px;
}

.contact-details {
    text-align: center;
}

.company-name {
    font-size: 1.5rem;
    font-weight: 400;
    color: #333333;
    margin-bottom: 15px;
}

.phone-label {
    color: #888888;
    font-size: 0.9rem;
    margin: 5px 0;
}

.phone-number {
    color: #127c94;
    font-size: 1.1rem;
    text-decoration: none;
}

.phone-number:hover {
    text-decoration: underline;
}

/* =========================================
   VENTANA EXPANSIVA DE PRODUCTOS (Modal)
   ========================================= */

/* Hacemos que las tarjetas del catálogo parezcan botones */
.grid-productos .product-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-productos .product-card:hover {
    transform: translateY(-5px); /* Se levanta un poco al pasar el mouse */
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* El fondo oscuro de la ventana */
.modal-detalle {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

/* La caja blanca central */
.modal-detalle-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease; /* Efecto de aparición */
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* El botón de cerrar (la X) */
.close-detalle {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.3s;
}

.close-detalle:hover {
    color: #cc0000;
}

/* Acomodo Izquierda/Derecha */
.detalle-layout {
    display: flex;
    gap: 40px;
    align-items: center;
}

.detalle-info {
    flex: 1; /* Ocupa la mitad izquierda */
}

.detalle-info h3 {
    font-size: 2.2rem;
    color: #333;
    margin: 10px 0 20px;
}

.detalle-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
}

.detalle-imagen {
    flex: 1; /* Ocupa la mitad derecha */
    text-align: center;
}

.detalle-imagen img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Adaptación para celulares (La imagen se pasa para arriba) */
@media (max-width: 768px) {
    .detalle-layout {
        flex-direction: column-reverse; 
        text-align: center;
    }
}

/* --- VARIABLES DEL MENÚ --- */
:root {
    --bg-navbar: #e0e0e0; 
    --text-color: #333333;
    --accent-color: #0066cc; 
    --date-color: #666666;
    --nav-height: 100px; /* Tamaño para el logo grande */
}

/* --- BARRA FIJA --- */
.nav-bar {
    background-color: var(--bg-navbar);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 
    position: fixed; 
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- LOGO GRANDE --- */
.logo-imagen {
    height: 75px; 
    width: auto;
    display: block;
    object-fit: contain;
}

/* --- ESPACIO PARA QUE EL MENÚ NO TAPE LA PÁGINA --- */
body { 
    margin: 0;   
    padding: 0;  
    padding-top: 100px; /* Debe coincidir con --nav-height */
}

/* =========================================
   ADAPTACIÓN GLOBAL PARA CELULARES
   (Pegar al final de todos los archivos CSS)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Ajustes del Menú y Encabezado */
    .nav-container {
        height: auto;
        padding: 10px;
    }
    
    .logo-imagen {
        height: 55px; /* Reducimos el logo en móviles */
    }

    .nav-container ul {
        flex-wrap: wrap; /* Permite que los enlaces bajen de renglón si no caben */
        justify-content: center;
        gap: 12px;
        padding-bottom: 10px;
    }

    .nav-container ul li a {
        font-size: 0.9rem; /* Enlaces ligeramente más pequeños */
    }

    body {
        padding-top: 140px; /* Compensa el menú apilado que es más alto */
    }

    /* 2. Ajustes de Contenedores y Formularios (Login, Agregar) */
    .container, .login-box {
        width: 90%;
        margin: 20px auto;
        padding: 20px;
    }

    /* 3. Ajustes de Tablas (Listas de productos/automatización) */
    .table-container {
        width: 95%;
        margin: 20px auto;
        padding: 10px;
        overflow-x: auto; /* Permite deslizar la tabla hacia los lados si no cabe */
    }
    
    table {
        min-width: 600px; /* Evita que las columnas se aplasten demasiado */
    }

    /* 4. Ajuste de la Ventana Emergente (Modales) */
    .modal-detalle-content, .modal-content {
        padding: 25px 20px; 
        width: 90%; 
        margin-top: 20px;
    }

    .detalle-layout {
        flex-direction: column-reverse; /* Pone la imagen arriba y el texto abajo */
        gap: 20px;
        text-align: center;
    }

    .detalle-info h3 {
        font-size: 1.6rem;
    }

    .close-detalle, .close-btn {
        top: 5px;
        right: 15px;
        font-size: 30px;
    }

    /* 5. Ajustes de Cuadrículas y Catálogos */
    .grid-productos {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* 1 tarjeta por renglón */
        gap: 20px;
    }

    /* 6. Ajustes de Paneles (Dashboard / Mi Cuenta) */
    .dashboard-grid {
        flex-direction: column; /* Apila los cuadros uno sobre otro */
    }
    
    /* 7. Ajustes del Index (Hero y Secciones) */
    .hero-section {
        min-height: 250px;
        height: 35vh;
    }
    .hero-title {
        font-size: 2rem; 
    }
    .products-section, .catalogo-section, .info-section, .contact-section {
        padding: 40px 15px;
    }
}