/* ═══════════════════════════════════════════════════════════════
   IEP Shop — Archive layout CSS
   Blue Ark Solutions © 2025
   ═══════════════════════════════════════════════════════════════ */

:root {
    --iep-shop-sidebar-w: 240px;
    --iep-shop-gap:       32px;
    --iep-shop-pad:       40px;

    /* Overlay etiqueta categoría */
    --iep-overlay-bg:      rgba(0,0,0,0.82);
    --iep-overlay-color:   #ffffff;
    --iep-overlay-font:    var(--iep-font-sans, 'DM Sans', system-ui, sans-serif);
    --iep-overlay-size:    11px;
    --iep-overlay-weight:  600;
    --iep-overlay-spacing: .1em;
    --iep-overlay-pad-v:   8px;
    --iep-overlay-pad-h:   14px;
}

/* ── Overlay compartido (slider + galería + archivo) ──────────── */
.iep-slide-img-wrap,
.iep-gallery-img-wrap,
.iep-cat-banner {
    position: relative;
}
.iep-cat-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    background: var(--iep-overlay-bg, rgba(0,0,0,0.82));
    color:       var(--iep-overlay-text, #ffffff);
    font-family: var(--iep-overlay-font);
    font-size:   var(--iep-overlay-size);
    font-weight: var(--iep-overlay-weight);
    letter-spacing: var(--iep-overlay-spacing);
    text-transform: uppercase;
    padding: var(--iep-overlay-pad-v) var(--iep-overlay-pad-h);
    line-height: 1;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity .4s ease .2s;
}
/* Aparece cuando el slider está listo o en galería directamente */
.iep-slider-wrap.iep-ready .iep-cat-overlay,
.iep-gallery-card .iep-cat-overlay,
.iep-cat-banner .iep-cat-overlay {
    opacity: 1;
}

/* ── Category archive banner — contenedor con espacios laterales ── */
.iep-cat-banner {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 0;
}
.iep-cat-banner img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}
.iep-cat-banner .iep-cat-overlay {
    opacity: 1;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    letter-spacing: .14em;
}

/* ── Main layout ─────────────────────────────────────────────── */
.iep-shop-layout {
    display: grid;
    grid-template-columns: var(--iep-shop-sidebar-w) 1fr;
    gap: var(--iep-shop-gap);
    padding: var(--iep-shop-pad) 0;
    align-items: start;
}

.iep-shop-mobile-filter { display: none; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.iep-shop-sidebar {
    grid-column: 1;
    position: sticky;
    top: 100px;
}
.iep-sidebar-title {
    font-family: var(--iep-font-sans, 'DM Sans', sans-serif);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6B7280;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E2E8EA;
}

/* ── Category tree ────────────────────────────────────────────── */
.iep-cat-tree,
.iep-cat-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.iep-cat-tree li { margin: 0; }
.iep-cat-tree a {
    display: block;
    padding: 5px 0;
    font-family: var(--iep-font-sans, 'DM Sans', sans-serif);
    font-size: 13px;
    color: #1B212B;
    text-decoration: none;
    transition: color .2s;
}
.iep-cat-tree a:hover { color: var(--iep-gold-end, #B89550); }
.iep-cat-tree .iep-cat-active > a { color: var(--iep-gold-end, #B89550); font-weight: 600; }

.iep-cat-tree ul {
    padding-left: 14px;
    border-left: 1px solid #E2E8EA;
    margin-left: 4px;
}
.iep-cat-tree ul a { font-size: 12px; color: #6B7280; }

/* ── Acordeón — animación suave con max-height ────────────────── */
.iep-cat-tree li.iep-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.iep-cat-tree li.iep-has-children > a::after {
    content: '+';
    font-size: 15px;
    font-weight: 300;
    color: #6B7280;
    flex-shrink: 0;
    transition: transform .3s ease, opacity .3s ease;
    display: inline-block;
    width: 16px;
    text-align: center;
}
.iep-cat-tree li.iep-has-children.iep-open > a::after {
    transform: rotate(45deg);
}
/* Subcategorías: ocultas con max-height 0 para transición suave */
.iep-cat-tree li.iep-has-children > ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4,0,.2,1),
                opacity    .3s ease;
    opacity: 0;
    margin-top: 0;
}
.iep-cat-tree li.iep-has-children.iep-open > ul {
    max-height: 600px;
    opacity: 1;
    margin-top: 2px;
}

/* ── Product grid ─────────────────────────────────────────────── */
.iep-shop-main { grid-column: 2; }

.iep-shop-main ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.iep-shop-main ul.products li.product {
    margin: 0 !important;
    float: none !important;
    width: auto !important;
}
.iep-shop-main ul.products li.product a img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.iep-shop-main ul.products li.product:hover a img {
    transform: translateY(-4px);
}
.iep-shop-main ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--iep-font-sans, 'DM Sans', sans-serif);
    font-size: 13px;
    font-weight: 400;
    color: #1B212B;
    margin: 8px 0 0;
    padding: 0;
    text-align: center;
}
.iep-shop-main ul.products li.product .price {
    display: none !important;
}

/* ── No products message ──────────────────────────────────────── */
.iep-no-products {
    text-align: center;
    padding: 60px 24px;
    color: #6B7280;
}
.iep-no-products p {
    font-family: var(--iep-font-sans, 'DM Sans', sans-serif);
    font-size: 15px;
    margin-bottom: 20px;
}

/* ── Tablet + Mobile ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .iep-shop-layout { display: block; padding: 24px 0; }
    .iep-shop-sidebar { display: none; }
    .iep-shop-mobile-filter { display: block; margin-bottom: 20px; }
    .iep-cat-select {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid #E2E8EA;
        font-size: 14px;
        font-family: var(--iep-font-sans, 'DM Sans', sans-serif);
        background: #fff;
        appearance: auto;
        cursor: pointer;
    }
}
@media (max-width: 640px) {
    .iep-shop-main ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    .iep-cat-banner { max-height: 280px; }
    .iep-cat-banner img { height: 280px; }
}

/* Overlay force-visible (override any theme interference) */
.iep-cat-banner .iep-cat-overlay,
.iep-slide-img-wrap .iep-cat-overlay,
.iep-gallery-img-wrap .iep-cat-overlay {
    position: absolute !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 10 !important;
    background: rgba(0,0,0,0.82) !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 8px 14px;
    line-height: 1;
    pointer-events: none;
}
.iep-cat-banner .iep-cat-overlay {
    font-size: 14px;
    padding: 12px 20px;
}

/* Label debajo del banner de categoria */
.iep-cat-banner-label {
    font-family: var(--iep-font-sans, 'DM Sans', system-ui, sans-serif);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6B7280;
    text-align: center;
    margin: 10px 0 0;
    padding: 0;
}

/* Ocultar filtro de ordenamiento en archivo */
.woocommerce-ordering { display: none !important; }
