/* ============================================
   VARIABLES DE COLORES CORPORATIVOS
   Aquí defines los colores principales de TUZALUD
   Para cambiar un color, solo modifícalo aquí y se actualiza en toda la página
============================================ */
:root {
    --azul-principal: #0e76b7;    /* Azul TUZALUD (predominante) */
    --verde-acento: #6ba94d;      /* Verde TUZALUD (detalles que destacan) */
    --azul-oscuro: #0a5a8a;       /* Azul más oscuro (sombras y variantes) */
    --verde-oscuro: #538a3a;      /* Verde más oscuro (sombras) */
    --gris-claro: #f5f7fa;        /* Fondo de la página */
    --gris-medio: #e1e8ed;        /* Bordes y separadores */
    --texto-oscuro: #2c3e50;      /* Color del texto principal */
    --blanco: #ffffff;            /* Blanco puro */
}

/* ============================================
   RESET GLOBAL
   Elimina márgenes y paddings por defecto del navegador
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

html {
    scroll-behavior: smooth;  /* Desplazamiento suave al hacer clic en enlaces */
}

body {
    background: var(--gris-claro);
    color: var(--texto-oscuro);
    line-height: 1.6;
}

/* ============================================
   ENCABEZADO (HEADER)
   Incluye: barra de bienvenida, barra de contacto y navegación
============================================ */
header {
    position: sticky;       /* Se queda fijo al hacer scroll */
    top: 0;
    z-index: 1000;         /* Siempre por encima de otros elementos */
    background: var(--blanco);
    box-shadow: 0 4px 20px rgba(14, 118, 183, 0.15);
}

/* BARRA SUPERIOR - Mensaje de bienvenida */
.top-bar {
    background: linear-gradient(135deg, var(--azul-principal) 0%, var(--azul-oscuro) 100%);
    color: var(--blanco);
    text-align: center;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
}

/* BARRA DE CONTACTO MAYOREO - Nueva barra azul */
.contact-bar {
    background: var(--azul-principal);
    color: var(--blanco);
    text-align: center;
    padding: 8px 20px;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid var(--verde-acento);
}

/* NAVEGACIÓN PRINCIPAL */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 5%;
    gap: 25px;
    flex-wrap: wrap;
    background: var(--blanco);
}

/* LOGO */
.logo img {
    height: 70px;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);  /* Crece un poco al pasar el mouse */
}

/* ============================================
   CAJA DE BÚSQUEDA
   Incluye el input y los resultados en tiempo real
============================================ */
.search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    border: 2px solid var(--azul-principal);
    border-radius: 30px;
    padding: 8px 20px;
    position: relative;
    background: var(--blanco);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(14, 118, 183, 0.1);
}

/* Efecto al hacer clic en la búsqueda */
.search-box:focus-within {
    border-color: var(--verde-acento);
    box-shadow: 0 4px 20px rgba(107, 169, 77, 0.2);
    transform: translateY(-2px);
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px;
    font-size: 15px;
    color: var(--texto-oscuro);
    background: transparent;
}

.search-box input::placeholder {
    color: #95a5a6;
}

/* RESULTADOS DE BÚSQUEDA (dropdown) */
.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--blanco);
    border: 2px solid var(--azul-principal);
    border-radius: 15px;
    margin-top: 5px;
    box-shadow: 0 10px 30px rgba(14, 118, 183, 0.2);
    max-height: 450px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--gris-medio);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: linear-gradient(90deg, rgba(14, 118, 183, 0.08) 0%, rgba(107, 169, 77, 0.08) 100%);
    transform: translateX(5px);
}

.search-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--gris-claro);
    padding: 5px;
    border: 2px solid var(--gris-medio);
}

.search-item div {
    flex: 1;
}

.search-item strong {
    display: block;
    color: var(--azul-principal);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.search-item small {
    color: #7f8c8d;
    font-size: 13px;
}

/* ============================================
   MENÚ DE NAVEGACIÓN
============================================ */
.menu {
    display: flex;
    gap: 30px;
    font-weight: 600;
    font-size: 16px;
}

.menu a {
    color: var(--azul-principal);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

/* Línea animada debajo del menú al pasar el mouse */
.menu a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--verde-acento);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.menu a:hover {
    color: var(--verde-acento);
}

.menu a:hover::after {
    width: 60%;
}

/* ============================================
   BOTÓN FLOTANTE DE WHATSAPP
   Botón verde siempre visible en la esquina
============================================ */
.whatsapp-float {
    position: fixed;           /* Se queda fijo aunque hagas scroll */
    bottom: 25px;             /* 25px desde abajo */
    right: 25px;              /* 25px desde la derecha */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #20ba5a);
    border-radius: 50%;       /* Círculo perfecto */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 25px rgba(37, 211, 102, 0.5);
    z-index: 9999;            /* Siempre encima de todo */
    transition: all 0.3s ease;
    cursor: pointer;
    animation: pulseWhatsApp 2s infinite;  /* Animación de pulso */
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(37, 211, 102, 0.7);
}

.whatsapp-icon {
    width: 35px;
    height: 35px;
    color: var(--blanco);
}

/* Animación de pulso del botón WhatsApp */
@keyframes pulseWhatsApp {
    0%, 100% {
        box-shadow: 0 5px 25px rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 5px 35px rgba(37, 211, 102, 0.8);
    }
}

/* ============================================
   BANNER SLIDER (Carrusel de imágenes)
============================================ */
.banner-container {
    width: 100%;
    max-width: 1920px;
    height: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gris-claro) 0%, var(--gris-medio) 100%);
    border-radius: 0 0 30px 30px;
}

.slide {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: none;
    animation: slideIn 0.8s ease-in-out;
}

.slide.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* PUNTOS DE NAVEGACIÓN DEL SLIDER */
.dots {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--azul-principal);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s ease;
}

.dot:hover {
    transform: scale(1.3);
    background: rgba(107, 169, 77, 0.8);
    border-color: var(--verde-acento);
}

.dot.active {
    background: var(--verde-acento);
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(107, 169, 77, 0.6);
}

/* ============================================
   TÍTULOS DE SECCIÓN
   Ejemplo: "CONOCE NUESTRO CATÁLOGO"
============================================ */
.titulo {
    text-align: center;
    color: var(--azul-principal);
    margin: 50px 0 35px 0;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Línea verde arriba del título */
.titulo::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--verde-acento);
    border-radius: 2px;
}

/* Línea azul debajo del título */
.titulo::after {
    content: '';
    display: block;
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--azul-principal), transparent);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ============================================
   GRID DE PRODUCTOS Y CATEGORÍAS
   Distribución de tarjetas en cuadrícula
============================================ */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 30px 5%;
    margin-bottom: 40px;
}

/* TARJETA DE PRODUCTO/CATEGORÍA */
.card {
    border: 3px solid var(--gris-medio);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    width: 260px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--blanco);
    position: relative;
    overflow: hidden;
}

/* Línea de colores en la parte superior (invisible hasta hover) */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--azul-principal), var(--verde-acento));
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Efecto al pasar el mouse sobre la tarjeta */
.card:hover {
    border-color: var(--azul-principal);
    box-shadow: 0 15px 40px rgba(14, 118, 183, 0.25);
    transform: translateY(-10px) scale(1.02);
}

.card:hover::before {
    opacity: 1;  /* Muestra la línea de colores */
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.4s ease;
}

/* La imagen crece y rota un poco al pasar el mouse */
.card:hover img {
    transform: scale(1.1) rotate(2deg);
}

.card h3, .card h4 {
    color: var(--azul-principal);
    margin: 12px 0;
    font-size: 18px;
    font-weight: 700;
}

.card p {
    color: #7f8c8d;
    font-size: 15px;
    margin: 8px 0;
    font-weight: 500;
}

/* ============================================
   PRODUCTOS DESTACADOS / LO MÁS VENDIDO
============================================ */
.destacados-grid {
    background: linear-gradient(135deg, rgba(14, 118, 183, 0.05) 0%, rgba(107, 169, 77, 0.05) 100%);
    border-radius: 25px;
    padding: 40px 30px !important;
    border: 3px dashed var(--azul-principal);
    position: relative;
}

/* Etiqueta "LO MÁS VENDIDO" arriba de la sección */
.destacados-grid::before {
    content: '⭐ LO MÁS VENDIDO';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--verde-acento);
    color: var(--blanco);
    padding: 8px 25px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(107, 169, 77, 0.4);
}

/* Estilo especial para productos destacados */
.card-destacado {
    border: 3px solid var(--verde-acento);
    background: var(--blanco);
    box-shadow: 0 8px 25px rgba(107, 169, 77, 0.2);
}

.card-destacado::before {
    height: 6px;
    background: linear-gradient(90deg, var(--verde-acento), var(--azul-principal));
    opacity: 1;
}

/* Badge "MÁS VENDIDO" en la esquina del producto */
.badge-destacado {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--verde-acento), var(--verde-oscuro));
    color: var(--blanco);
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(107, 169, 77, 0.4);
    z-index: 1;
    animation: pulse 2s infinite;  /* Pulso constante */
}

/* Animación de pulso para el badge */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(107, 169, 77, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(107, 169, 77, 0.6);
    }
}

/* ============================================
   IMAGEN DE FACHADAS
   Foto de las sucursales a ancho completo
============================================ */
.fachadas-container {
    width: 100%;
    margin: 50px 0;
    overflow: hidden;
}

.fachadas-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 600px;
}

/* ============================================
   MODAL DE PRODUCTO
   Ventana emergente con detalles del producto
============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);  /* Fondo oscuro transparente */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(5px);  /* Efecto de desenfoque del fondo */
}

.modal-content {
    background: var(--blanco);
    padding: 40px;
    border-radius: 25px;
    max-width: 850px;
    width: 90%;
    display: flex;
    gap: 30px;
    position: relative;
    align-items: center;
    animation: modalSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 4px solid var(--azul-principal);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlide {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Botón X para cerrar modal */
.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    cursor: pointer;
    color: #95a5a6;
    transition: all 0.3s;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gris-claro);
}

.close-modal:hover {
    color: var(--blanco);
    background: var(--azul-principal);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--azul-principal);
    font-size: 26px;
    margin-bottom: 10px;
    font-weight: 700;
}

.modal-content #modalMarca {
    color: var(--verde-acento);
    font-weight: 600;
    font-size: 16px;
}

.modal-content #modalDesc {
    color: var(--texto-oscuro);
    line-height: 1.8;
    font-size: 15px;
    margin: 15px 0;
}

/* Botón de WhatsApp en el modal */
.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #20ba5a);
    color: var(--blanco);
    padding: 15px 30px;
    border-radius: 30px;
    display: block;
    text-align: center;
    margin-top: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #20ba5a, #1a9448);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp::before {
    content: "💬 ";
    margin-right: 5px;
}

/* Botón "Ver más de esta categoría" */
.btn-categoria {
    background: linear-gradient(135deg, var(--azul-principal), var(--azul-oscuro));
    color: var(--blanco);
    padding: 12px 25px;
    border-radius: 30px;
    display: block;
    text-align: center;
    margin-top: 12px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-categoria:hover {
    background: var(--blanco);
    color: var(--azul-principal);
    border-color: var(--azul-principal);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE - ADAPTACIÓN A MÓVILES
   Se activa cuando la pantalla es menor a 768px
============================================ */
@media (max-width: 768px) {
    nav {
        justify-content: center;
    }

    .logo img {
        height: 55px;
    }

    .search-box {
        max-width: 100%;
        order: 3;
        width: 100%;
    }

    .menu {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 15px;
    }

    .menu a {
        padding: 8px 15px;
        font-size: 14px;
    }

    .banner-container {
        height: 300px;
        border-radius: 0 0 20px 20px;
    }

    .titulo {
        font-size: 24px;
        margin: 35px 0 25px 0;
    }

    .modal-content {
        flex-direction: column;
        padding: 25px;
    }

    .modal-content img {
        width: 100% !important;
    }

    .card {
        width: 100%;
        max-width: 320px;
    }

    .destacados-grid::before {
        font-size: 12px;
        padding: 6px 15px;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }
}

/* Para pantallas MUY pequeñas (celulares) */
@media (max-width: 480px) {
    .top-bar {
        font-size: 13px;
        padding: 10px 15px;
    }

    .contact-bar {
        font-size: 12px;
        padding: 6px 15px;
    }

    .banner-container {
        height: 250px;
    }

    .grid {
        padding: 20px 3%;
    }

    .titulo {
        font-size: 20px;
    }
}

/* ============================================
   SCROLLBAR PERSONALIZADO
   Barra de desplazamiento con colores TUZALUD
============================================ */
.search-results::-webkit-scrollbar {
    width: 10px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--gris-claro);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--azul-principal), var(--verde-acento));
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--azul-oscuro), var(--verde-oscuro));
}

/* ============================================
   ANIMACIONES ADICIONALES
============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Productos destacados flotan al pasar el mouse */
.card-destacado:hover {
    animation: float 2s ease-in-out infinite;
}

/* Animación de aparición suave */
.grid, .titulo {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
