@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* === TOP BAR === */
.top {
    width: 100%;
    height: 2.8vw;
    background-color: #0080FF;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #fff;
    font-size: .7vw;
    font-weight: 500;
}

.text-top {
    display: flex;
}

.text-top p {
    padding-right: 2vw;
}

/* === HEADER PRINCIPAL === */
.top-2 {
    background-image: url(/src/img/top-2.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 0 14vw;
}

/* === LOGO Y BÚSQUEDA === */
.logo-buscar {
    width: 100%;
    height: 5.5vw;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.logo img {
    width: 12vw;
    height: auto;
}

.buscar form {
    width: 20vw;
    height: 2.2vw;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #0080FF;
    border-radius: .3vw;
    overflow: hidden;
}

.buscar input {
    width: 80%;
    height: 100%;
    border: none;
    padding-left: 1vw;
    font-size: 1vw;
    outline: none;
}

.buscar button {
    width: 20%;
    height: 100%;
    border: none;
    background-color: #0080FF;
    color: #fff;
    font-size: 1vw;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.buscar button:hover {
    background-color: #0062c4;
}

.carrito {
    display: flex;
    align-items: center;
    color: #ffffff;
    font-size: 1vw;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    gap: .3vw;
}

.carrito i {
    font-size: 1.5vw;
}

/* === MENÚ PRINCIPAL === */
.cat-list-p {
    display: flex;
    justify-content: space-around;
}

.list-prod {
    width: 18vw;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    background: #fff;
    position: relative;
}

.menu-header {
    display: flex;
    align-items: center;
    background: #0080FF;
    color: #fff;
    padding: 12px;
    font-weight: bold;
    border-radius: 6px 6px 0 0;
    font-size: .9vw;
    cursor: pointer;
}

.menu-header .menu-toggle {
    background: none;
    border: none;
    font-size: 1vw;
    color: #fff;
    cursor: pointer;
    margin-right: 20px;
}

/* === LISTA DE CATEGORÍAS === */
.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    background-color: #fff;
    width: 18vw;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 6px 6px;
    z-index: 10000;
    /* JavaScript controla el display */
}

.menu-list>li {
    border-bottom: 1px solid #eee;
    position: relative;
}

.menu-list>li:last-child {
    border-bottom: none;
}

/* Categorías principales (sin enlace) */
.menu-list>li>.category-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    color: #222;
    font-size: 0.9vw;
    font-weight: 600;
    transition: background 0.3s ease;
    cursor: pointer;
}

.menu-list>li>.category-title:hover {
    background: #f5f5f5;
    color: #0080FF;
}

.menu-list>li>.category-title.active {
    background: #0080FF;
    color: #fff;
}

/* Submenú horizontal para desktop */
.submenu {
    list-style: none;
    padding: 15px;
    margin: 0;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    position: absolute;
    top: 0;
    left: 100%;
    width: 22vw;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.submenu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.submenu::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent #fff transparent transparent;
    filter: drop-shadow(-1px 0px 1px rgba(0, 0, 0, 0.1));
}

.submenu li {
    margin-bottom: 8px;
}

.submenu li:last-child {
    margin-bottom: 0;
}

.submenu a {
    display: block;
    padding: 8px 12px;
    color: #555;
    font-weight: 500;
    font-size: 0.9vw;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.submenu a:hover {
    background: #f0f8ff;
    color: #0080FF;
    transform: translateX(5px);
}

/* === ENLACES NAVEGACIÓN === */
.enlaces {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
}

.enlaces a {
    text-decoration: none;
    color: #fff;
    font-size: .9vw;
    font-weight: 600;
    transition: all 0.3s ease;
}

.enlaces a:hover {
    color: #0080FF;
    transform: scale(1.05);
}

.envios {
    color: #fff;
    font-size: .9vw;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5vw;
}

/* === STICKY HEADER === */
.cat-list-p.fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-image: url(/src/img/top-2.png);
    padding: 1vw 14vw 0 14vw;
    transition: all 0.3s ease;
}

.pc {
    display: none;
}

.separador-paralelas {
    display: none;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1280px) {
    .top {
        font-size: .9vw;
    }

    .top-2 {
        padding: 0 3vw;
    }

    .menu-header {
        font-size: 1.3vw;
    }

    .list-prod,
    .menu-list {
        width: 23vw;
    }

    .submenu {
        width: 25vw;
    }
}

@media (max-width: 1024px) {
    .cell {
        display: none;
    }

    .pc {
        display: block;
    }

    .logo-buscar-cell {
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        height: 7vw;
    }

    .top {
        font-size: 1.8vw;
        flex-direction: column;
        height: auto;
        padding: 1.5vw 0;
        gap: 2vw;
        text-align: center;
    }

    .top-2 {
        padding: 2.5vw 0;
    }

    .logo-buscar-cell {
        height: auto;
        padding: 1.1vw 0;
        position: relative;
        margin-bottom: 3vw;
    }

    .logo img {
        width: 35vw;
    }

    .bus-car {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }

    #btnBuscar {
        background-color: #0080FF;
        width: auto;
        height: 8vw;
        font-size: 4vw;
        color: #ffffff;
        cursor: pointer;
        padding: 0 .5em;
        border: none;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    #btnBuscar:hover {
        background-color: #0062c4;
    }

    .carrito a {
        text-decoration: none;
        color: #ffffff;
        font-size: 2.5vw;
    }

    .carrito i {
        font-size: 3.5vw;
    }

    /* === FORMULARIO BÚSQUEDA MÓVIL === */
    #formBuscar {
        width: 100%;
        position: absolute;
        top: 100%;
        background: white;
        border: 1px solid #ddd;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        padding: 5px;
        z-index: 1000;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        pointer-events: none;
    }

    #formBuscar.activo {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    #formBuscar input {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 1.2em;
        outline: none;
        transition: border-color 0.3s ease;
    }

    #formBuscar input:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

    #formBuscar button {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: #007bff;
        color: white;
        border: none;
        padding: 8px 12px;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    #formBuscar button i {
        font-size: 1.7rem;
    }

    #formBuscar button:hover {
        background: #0056b3;
    }

    /* === OVERLAY === */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        z-index: 999;
        display: none;
    }

    .overlay.activo {
        display: block;
    }

    /* === HEADER MÓVIL === */
    .mobile-header {
        width: 100%;
        padding-bottom: 2vw;
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: relative;
    }

    .hamburger-menu {
        background: #007bff;
        border: none;
        font-size: 5vw;
        cursor: pointer;
        height: 8vw;
        padding: 0 .5em;
        color: #ffffff;
        border-radius: 5px;
        transition: transform 0.3s ease;
    }

    .hamburger-menu:hover {
        transform: scale(1.1);
    }

    .envios-text {
        color: #ffffff;
        font-size: 2.5vw;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .envios-text i {
        color: #0080FF;
        font-size: 4vw;
    }

    /* === MENÚ LATERAL MÓVIL === */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .side-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100%;
        background-color: white;
        z-index: 1002;
        transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    }

    .side-menu.active {
        left: 0;
    }

    .menu-header-mobile {
        background-color: #0080FF;
        color: white;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .menu-title {
        font-size: 18px;
        font-weight: bold;
    }

    .close-btn {
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
    }

    /* Enlaces principales móvil */
    .main-links {
        padding: 0;
        margin: 0;
    }

    .main-links li {
        list-style: none;
        border-bottom: 1px solid #eee;
    }

    .main-links li a {
        display: block;
        padding: 15px 20px;
        text-decoration: none;
        color: #333;
        font-size: 16px;
        transition: all 0.3s ease;
    }

    .main-links li a:hover,
    .main-links li a.active {
        background-color: #f8f9fa;
        color: #0080FF;
        padding-left: 25px;
    }

    .menu-separator {
        height: 1px;
        background-color: #ddd;
        margin: 10px 0;
    }

    /* === PRODUCTOS MÓVIL === */
    .productos-section {
        padding: 0;
    }

    .productos-title {
        background-color: #f8f9fa;
        padding: 15px 20px;
        font-weight: bold;
        color: #333;
        border-bottom: 1px solid #eee;
    }

    .productos-list {
        padding: 0;
        margin: 0;
    }

    .productos-list>li {
        list-style: none;
        border-bottom: 1px solid #eee;
    }

    /* Categorías principales móvil */
    .mobile-category {
        padding: 12px 20px;
        color: #333;
        font-weight: 600;
        background: #f8f9fa;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.3s ease;
    }

    .mobile-category:hover {
        background-color: #e9ecef;
        color: #0080FF;
    }

    /* Submenú móvil (mantener como acordeón) */
    .mobile-submenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        background: #fff;
    }

    .mobile-submenu.active {
        max-height: 300px;
    }

    .mobile-submenu a {
        display: block;
        padding: 10px 30px;
        color: #555;
        font-size: 14px;
        transition: all 0.3s ease;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-submenu a:hover {
        background-color: #f8f9fa;
        color: #0080FF;
        padding-left: 35px;
    }

    .separador-paralelas {
        border: none;
        height: 6px;
        background: linear-gradient(to right,
                transparent 0%,
                #0080FF 25%,
                #0080FF 35%,
                transparent 40%,
                transparent 60%,
                #0080FF 65%,
                #0080FF 75%,
                transparent 100%);
        margin: 0 0 15px 0;
    }

    .fixed {
        position: fixed;
        top: 0;
        left: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        background-image: url(/src/img/top-2.png);
        z-index: 1000;
        transition: all 0.3s ease;
    }
}