:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header & Navigation */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 50px;
    object-fit: contain;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary-color);
}

/* Cart Icon */
.cart-header {
    position: relative;
    font-size: 1.2rem;
    color: var(--secondary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.cart-header:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

/* Mega Menu Styles */
.has-mega {
    position: static;
    /* Importante para que el mega menú sea relativo al header/viewport */
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eee;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    padding: 2rem 5%;
    z-index: 999;
}

.has-mega:hover .mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.container-mega {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.mega-column h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.mega-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    list-style: none;
}

.mega-column ul li a {
    font-weight: 400;
    color: #666;
    font-size: 0.95rem;
}

.mega-column ul li a:hover {
    padding-left: 5px;
    color: var(--primary-color);
}

.mega-image {
    max-width: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.mega-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.has-mega:hover .mega-image img {
    transform: scale(1.1);
}

/* Banner / Hero Section */
.hero {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
}

.swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.hero-content {
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    margin-top: 1rem;
    transition: var(--transition);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Catalog Grid */
.container {
    padding: 3rem 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.price-contado {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
}

.price-cuotas {
    font-size: 0.9rem;
    color: #666;
}

.btn-view {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--secondary-color);
    color: white;
    padding: 0.8rem;
    text-decoration: none;
    margin-top: 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-view:hover {
    background: var(--primary-color);
}

.btn-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 1.2rem;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-cart:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.btn-add-cart i {
    font-size: 1.2rem;
}

/* Modal / Product Details */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.gallery-container {
    position: relative;
}

.main-img-container {
    overflow: hidden;
    border-radius: 15px;
    cursor: zoom-in;
}

.main-img-container img {
    width: 100%;
    transition: transform 0.3s ease;
}

.main-img-container:hover img {
    transform: scale(1.5);
}

.thumbnails {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumb.active {
    border-color: var(--primary-color);
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-decoration: none;
}

/* Mobile Navigation Enhancements */
.hamburger-menu {
    display: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    justify-content: space-around;
    padding: 0.8rem 0;
    border-radius: 20px 20px 0 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #888;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.cart-header.mobile-only-cart {
    display: none;
}

@media (min-width: 993px) {

    /* Hide the mobile cart on desktop */
    header div>a.cart-header {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .desktop-only-cart {
        display: none !important;
    }

    header div>a.cart-header {
        display: flex !important;
    }
}

/* Mobile Drawer */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2005;
    display: none;
    backdrop-filter: blur(3px);
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: -80%;
    width: 80%;
    height: 100%;
    background: var(--white);
    z-index: 2006;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
}

.mobile-menu-drawer.open {
    left: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.drawer-close {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-color);
}

.drawer-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drawer-nav a {
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.drawer-nav .sub-items {
    padding-left: 2rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border-left: 2px solid #f0f0f0;
}

.drawer-nav .sub-items a {
    font-size: 0.95rem;
    font-weight: 400;
    color: #666;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    header nav {
        display: none;
    }

    .hamburger-menu {
        display: block;
    }

    .bottom-nav {
        display: flex;
    }

    .whatsapp-float {
        bottom: 5.5rem;
        /* Subir para que no tape la barra inferior */
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 25px;
    }

    .container {
        padding-bottom: 7rem;
        /* Espacio para la barra inferior */
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-card .product-info {
        padding: 1rem;
    }

    .product-info h3 {
        font-size: 1rem;
        height: 2.4rem;
        overflow: hidden;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .hero {
        height: 350px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-image {
        height: 200px;
    }
}

/* Footer Rediseñado */
.main-footer {
    background: #f0f0f0;
    color: #333333;
    padding: 3rem 0 1.5rem;
    margin-top: 5rem;
    border-top: 1px solid #e0e0e0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: #333333;
    text-transform: uppercase;
    font-weight: 700;
}

.footer-favicon {
    max-width: 60px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.footer-company-name {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    color: #333333;
}

.footer-contact-info p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #444444;
}

.footer-contact-info i {
    width: 25px;
    color: var(--primary-color);
}

.footer-menu-list {
    list-style: none;
    padding: 0;
}

.footer-menu-list li {
    margin-bottom: 0.8rem;
}

.footer-menu-list a {
    text-decoration: none;
    color: #444444;
    transition: var(--transition);
    font-weight: 500;
}

.footer-menu-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    color: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid #dcdcdc;
    font-size: 1.1rem;
}

.social-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 1.5rem 20px 0;
    border-top: 1px solid #dcdcdc;
    text-align: center;
    font-size: 0.9rem;
    color: #555555;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}