/* ================= BUSCADOR ================= */
.header-search {
    position: relative;
}

.header-search .search-toggle i {
	color: #000;
}

/* ---------- PANEL ---------- */
.search-panel {
    background: #fff;
    transition: .35s ease;
}

/* ---------- FORM ---------- */
.search-panel form {
    position: relative;
}

.search-panel input[type="search"] {
    width: 100%;
    padding: 10px 44px 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
}

/* icono lupa en submit */
.search-panel button[type="submit"] {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}



/* ---------- DESKTOP ---------- */
@media (min-width: 992px) {

    .search-toggle {
        display: none;
    }

    .search-panel {
        position: static;
        box-shadow: none;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .search-close {
        display: none;
    }
}

/* ---------- MOBILE ---------- */
@media (max-width: 991px) {

    .search-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,.2);
        z-index: 10000;

        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
    }

    .header-search.open .search-panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .search-toggle {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
		padding: 0px;
    }
	.search-toggle:hover {
        background: transparent;
		color: var(--ast-global-color-0);
    }

    .search-close {
        background: none;
        border: none;
        font-size: 20px;
        position: absolute;
        top: 18px;
        right: 20px;
        cursor: pointer;
    }
	.header-search .search-toggle i {
	font-size: 30px;
	padding-top: 8px;
}
}
/* BOTON BUSCAR CON ICONO */
.search-panel button[type="submit"] {
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* ICONO MATERIAL */
.search-panel button[type="submit"] i {
    font-size: 18px;
    color: #333;
}

/* hover */
.search-panel button[type="submit"]:hover i {
    color: var(--ast-global-color-0);
}

/* BOTON SUBMIT DEL BUSCADOR */
.search-panel button[type="submit"] {
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 0; /* oculta la palabra "Buscar" */
}

/* ICONO MATERIAL */
.search-panel button[type="submit"]::before {
    content: "search";
    font-family: "Material Icons Outlined";
    font-size: 20px;
    color: #333;
}

/* hover */
.search-panel button[type="submit"]:hover::before {
    color: var(--ast-global-color-0);
}

/* ================= HEADER BASE ================= */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* LOGO */
.header-logo img {
    max-height: 60px;
}

/* ================= MENU PRINCIPAL ================= */
.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-principal {
    display: flex;
    gap: 25px;
}

.menu-principal > li > .mega-menu-wrapper {
    top: 100%;
}

.menu-principal > li > a {
    display: block;
    padding: 20px 0;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.menu-principal > li:hover > a {
    color: var(--ast-global-color-0);
}

/* ================= SUBMENUS NORMALES (NO TIENDA) ================= */
.menu-principal > li:not(:has(.mega-menu)) > ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.menu-principal > li:not(:has(.mega-menu)):hover > ul {
    display: block;
}

.menu-principal ul li a {
    padding: 12px 15px;
    display: block;
    color: #333;
    text-decoration: none;
}

.menu-principal ul li a:hover {
    background: #f5f5f5;
}

/* ================= ACCIONES ================= */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ICONOS */

.header-social svg{
    width: 32px;
    height: 32px;
    transition: fill .3s ease;
    padding: 5px;
    border-radius: 50%;
}

.header-cart svg {
    width: 42px;
    height: 42px;
    fill: #000;
    transition: fill .3s ease;
    padding: 8px 5px 0 5px;
    border-radius: 50%;
}

.header-cart a:hover svg {
    fill: var(--ast-global-color-0);
}
.header-social svg{
    fill: #FFF;
    background-color: #000;
    
}
.header-social a:hover svg{
    background-color: var(--ast-global-color-0);
}
.header-cart {
    position: relative;
}

.cart-count {
    position: absolute;
    top: 8px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= MEGA MENU TIENDA ================= */

/* wrapper oculto */
.menu-principal > li > .mega-menu-wrapper {
    position: fixed;
    left: 0;
    top: 65px; /* ajustar a tu header */
    width: 100vw;
	padding: 20px 5%;

    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,.15);
    z-index: 9999;

    /* oculto */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .25s ease, visibility .25s ease;
}

/* mostrar SOLO al hover de Tienda */
.menu-principal > li:hover > .mega-menu-wrapper {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* grid interno */
.mega-menu {
    max-width: 1200px;
    margin: auto !important;
    padding: 40px 60px;

    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 40px;
}

/* reset */
.mega-menu,
.mega-menu ul,
.mega-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* columnas */
.mega-menu .mega-col > a {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
    margin-bottom: 12px;
	min-height: 65px;
    display: block;
    color: #000;
    text-decoration: none;
}

.mega-menu .mega-col ul li a {
    font-size: 13px;
    padding: 4px 15px;
    display: block;
    color: #555;
}

.mega-menu .mega-col ul li a:hover {
    color: var(--ast-global-color-0);
}

/* ================= HAMBURGUESA ================= */
.menu-toggle {
    display: none;
    width: 32px;
    height: 24px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: #222;
    transition: .3s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 10px;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 10px;
}


/* puente invisible para evitar corte de hover */
.menu-principal > li > .mega-menu-wrapper::before {
    content: "";
    position: absolute;
    top: -30px;          /* altura del puente */
    left: 0;
    width: 100%;
    height: 30px;
}
@media (max-width: 991px) {

    /* MEGA MENU PADRE */
    .menu-principal > li > .mega-menu-wrapper {
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
        padding: 0;
        overflow: hidden;

        max-height: 0;
        transition: max-height .45s ease;
    }

    .menu-principal > li.open > .mega-menu-wrapper {
        max-height: 2000px; /* suficientemente grande */
		
		width: 100%;
    }

    /* GRID A COLUMNA */
    .mega-menu {
        display: block;
        padding: 15px 20px;
    }

    /* SUBCATEGORIAS */
    .mega-col {
		
        padding: 10px 0;
    }
.mega-menu .mega-col > a {
    font-weight: 400;
    font-size: 14px;
	min-height: auto;
    text-transform: none !important;
    padding-bottom: 6px;
    margin-bottom: 12px;
	width: 100%;
  }
    .mega-col > a {
        position: relative;
        padding-right: 28px;
		text-transform: none;
		font-weight: 400;
    font-size: 14px;
    }

    /* ICONO */
    .mega-col > a::after {
        content: "+";
        position: absolute;
        right: 0;
        top: 0;
        font-size: 18px;
        transition: transform .3s ease;
    }

    .mega-col.open > a::after {
        content: "−";
    }

    /* SUBSUB */
    .mega-col ul {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height .35s ease, opacity .25s ease;
        padding-left: 15px;
        margin-top: 6px;
    }

    .mega-col.open ul {
        max-height: 500px;
        opacity: 1;
    }
.header-social {
    display: none;
}
header .menu-toggle span {
        width: 75%;
        height: 4px;
        background: #000;
    }
header .menu-toggle:hover {
    background-color: transparent;
}
    .menu-toggle:hover span {
    background: var(--ast-global-color-0);
        }
		
		
/*****Icono submenu * ********/
 /* =====================================================
       1️⃣ Items que tienen submenú (cualquier nivel)
       ===================================================== */

    .menu-principal li:has(> ul),
    .menu-principal li:has(.mega-menu-wrapper) {
        position: relative;
    }

    .menu-principal li:has(> ul) > a,
    .menu-principal li:has(.mega-menu-wrapper) > a {
        position: relative;
        padding-right: 40px;
    }

    /* =====================================================
       2️⃣ Icono base: +
       ===================================================== */

    .menu-principal li:has(> ul) > a::after,
    .menu-principal li:has(.mega-menu-wrapper) > a::after {
        content: "+";
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        font-weight: 600;
        pointer-events: none;
    }

    /* =====================================================
       3️⃣ Cuando el item está abierto → −
       ===================================================== */

    .menu-principal li.open > a::after {
        content: "−";
    }

    /* =====================================================
       4️⃣ FIX: al cerrar el menú mobile vuelve a +
       (Astra agrega .ast-header-break-point en mobile)
       ===================================================== */

    body:not(.ast-header-break-point)
    .menu-principal li.open > a::after {
        content: "+";
    }

    /* =====================================================
       5️⃣ Ajustes visuales para sub-submenús
       ===================================================== */

    .menu-principal ul ul li > a::after {
        font-size: 16px;
        right: 12px;
    }
}


.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: .3s;
    z-index: 900;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/************************************************************/
@media (max-width: 991px) {

    /* ===== BOTON ===== */
    .menu-toggle {
        display: block;
        width: 32px;
        height: 24px;
        position: relative;
        cursor: pointer;
        z-index: 1200;
    }

    .menu-toggle span {
        position: absolute;
        left: 0;
        width: 100%;
        height: 3px;
        background: #222;
        transition: .3s ease;
    }

    .menu-toggle span:nth-child(1) { top: 0; }
    .menu-toggle span:nth-child(2) { top: 10px; }
    .menu-toggle span:nth-child(3) { top: 20px; }

    /* ===== ICONO X ===== */
    #menu-toggle:checked + .menu-toggle span:nth-child(1) {
        transform: rotate(45deg);
        top: 10px;
    }

    #menu-toggle:checked + .menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    #menu-toggle:checked + .menu-toggle span:nth-child(3) {
        transform: rotate(-45deg);
        top: 10px;
    }

    /* ===== MENU ===== */
    .header-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #fff;
        padding: 90px 20px 20px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .35s ease;
        z-index: 1100;
    }

    #menu-toggle:checked ~ .header-nav {
        transform: translateX(0);
    }

    /* ===== OVERLAY ===== */
    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        opacity: 0;
        visibility: hidden;
        transition: .3s;
        z-index: 1000;
    }

    #menu-toggle:checked ~ .menu-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* ===== LISTA ===== */
    .menu-principal {
        flex-direction: column;
        gap: 0;
    }

    .menu-principal > li > a {
        padding: 14px 0;
        display: block;
        border-bottom: 1px solid #eee;
    }

    /* ===== SUBMENUS ===== */
    .menu-principal li > ul,
    .menu-principal > li > .mega-menu-wrapper {
        display: none;
        padding-left: 15px;
    }

    .menu-principal li:focus-within > ul,
    .menu-principal > li:focus-within > .mega-menu-wrapper {
        display: block;
    }

    /* ===== MEGA ===== */
    .mega-menu {
        display: block;
        padding: 10px 0;
    }

    .mega-col ul {
        display: none;
        padding-left: 15px;
    }

    .mega-col:focus-within ul {
        display: block;
    }
	
	@media (max-width: 991px) {

    /* ===== HEADER BASE ===== */
    .header-container {
        justify-content: space-between;
        gap: 12px;
    }

    /* ===== MOSTRAR HAMBURGUESA ===== */
    .menu-toggle {
        display: block;
        order: 3;
		z-index: 1100;
    }

    /* ===== ACCIONES VISIBLES ===== */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        order: 2;
        z-index: 1200;
    }

    /* ===== LOGO ===== */
    .header-logo {
        order: 1;
        z-index: 1200;
		
    }

    /* ===== MENU DESPLEGABLE ===== */
    .header-nav {
        top: 58px;
            left: 0;
            height: 100vh;
            padding-top: 10px;
            z-index: 1100;
    }

    /* ===== ICONOS NO TAPADOS ===== */
    .header-search,
    .header-cart,
    .header-social {
        position: relative;
        /*z-index: 1200;
    }

    /* ===== OVERLAY DEBAJO DEL HEADER ===== */
    .menu-overlay {
        z-index: 1050;
    }

/* ===== MENU MOBILE ACORDEON FINAL ===== */
@media (max-width: 991px) {

    /* ===== CONTENEDOR ===== */
    .menu-principal {
        width: 100%;
    }

    .menu-principal li {
        position: relative;
    }

    /* ===== LINKS ===== */
    .menu-principal li > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0px 14px 0px;
        text-decoration: none;
    }

  /* ==============================
   FLECHAS MOBILE (CSS PURO)
============================== */


    /* el link debe ser referencia */
    .menu-principal li > a {
        position: relative;
        padding-right: 40px;
    }

    /* Flecha principal */
    .menu-principal .menu-item-has-children > a::after {
        content: "";
        width: 8px;
        height: 8px;
        border-right: 2px solid #000;
        border-bottom: 2px solid #000;
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
        transition: transform .3s ease;
        pointer-events: none;
    }

    /* Flecha nivel 2 */
    .menu-principal .sub-menu 
    .menu-item-has-children > a::after {
        width: 6px;
        height: 6px;
    }

    /* Flecha abierta */
    .menu-principal li.open > a::after {
        transform: translateY(-50%) rotate(-135deg);
    }


    /* ===== SUBMENUS ===== */
    .menu-principal .sub-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }

    /* ===== ABIERTO ===== */
    .menu-principal li.open > a::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .menu-principal li.open > .sub-menu {
        max-height: 1000px;
    }



/* Todos los subniveles ocultos */
.mega-menu li > ul {
    display: none;
}

/* Solo se muestra el ul del li abierto */
.mega-menu li.open > ul {
    display: block;
}

/* Alineación del link + */
.mega-menu li > a {
    display: inline-block;
    vertical-align: middle;
}

.submenu-toggle {
    display: inline-block;
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    vertical-align: middle;
}
    
}
