:root {
    --azul-principal: #0e76b7;
    --verde-acento: #6ba94d;
    --azul-oscuro: #0a5a8a;
    --verde-oscuro: #538a3a;
    --gris-claro: #f5f7fa;
    --gris-medio: #e1e8ed;
    --texto-oscuro: #2c3e50;
    --blanco: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

/* ========================================
   HEADER - Barra superior y navegación
======================================== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--blanco);
    box-shadow: 0 4px 20px rgba(14, 118, 183, 0.15);
}

.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;
}

.top-bar::before {
    content: "📞 ";
    margin-right: 5px;
}

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

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

.logo:hover img {
    transform: scale(1.05);
}

/* ========================================
   BÚSQUEDA MEJORADA
======================================== */
.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);
}

.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;
}

.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;
}

.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%;
}

/* ========================================
   BANNER SLIDER
======================================== */
.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);
    }
}

.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
======================================== */
.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;
}

.titulo::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--verde-acento);
    border-radius: 2px;
}

.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
======================================== */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 30px 5%;
    margin-bottom: 40px;
}

.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;
}

.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;
}

.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;
}

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

.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
======================================== */
.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;
}

.destacados-grid::before {
    content: '⭐ RECOMENDADOS PARA TI';
    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);
}

.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-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;
}

@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);
    }
}

/* ========================================
   MODAL DE PRODUCTO
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(5px);
}

.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;
    }
}

.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;
}

.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;
}

.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 DESIGN
======================================== */
@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;
    }
}

@media (max-width: 480px) {
    .top-bar {
        font-size: 13px;
        padding: 10px 15px;
    }

    .banner-container {
        height: 250px;
    }

    .grid {
        padding: 20px 3%;
    }

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

/* ========================================
   SCROLLBAR PERSONALIZADO
======================================== */
.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));
}

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

.card-destacado:hover {
    animation: float 2s ease-in-out infinite;
}

/* Efecto de carga suave */
.grid, .titulo {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Botón de scroll to top (opcional) */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--verde-acento), var(--verde-oscuro));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blanco);
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(107, 169, 77, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(107, 169, 77, 0.6);
}
