/* ================================================================
   ARCHIVE V2 - Shop / categorías estilo Lady Pipa
   ================================================================ */

.mp-archive {
    background: #fff;
    padding: 40px max(20px, 3vw) 80px;
}

/* ----- Header de categoría ----- */
.mp-archive__header {
    text-align: center;
    padding: 20px 0 40px;
}
.mp-archive__title {
    font-family: var(--mp-font-sans, -apple-system, sans-serif);
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    margin: 0;
    color: #000;
    line-height: 1;
}
.mp-archive__desc {
    font-family: var(--mp-font-serif, Georgia, serif);
    font-style: italic;
    font-size: 0.95rem;
    color: #777;
    margin: 12px auto 0;
    max-width: 600px;
}

/* ----- Nav: subcategorías + filtros ----- */
.mp-archive__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 40px;
    gap: 20px;
    flex-wrap: wrap;
}

.mp-archive__subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: center;
}
.mp-archive__subcat {
    font-family: var(--mp-font-sans, -apple-system, sans-serif);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #999;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.18s ease;
    position: relative;
}
.mp-archive__subcat:hover { color: #000; }
.mp-archive__subcat.is-active {
    color: #000;
    text-decoration: underline;
    text-decoration-color: #000;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

/* Botón "+ N MÁS" subcategorías */
.mp-archive__more-subcats {
    background: transparent;
    border: 1px solid #d8d8d8;
    cursor: pointer;
    padding: 6px 14px;
    font-family: var(--mp-font-sans, -apple-system, sans-serif);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #000;
    transition: background 0.18s ease, border-color 0.18s ease;
    line-height: 1;
}
.mp-archive__more-subcats:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.mp-archive__filter-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font-family: var(--mp-font-sans, -apple-system, sans-serif);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #000;
    transition: opacity 0.2s ease;
}
.mp-archive__filter-btn:hover { opacity: 0.65; }

@media (max-width: 768px) {
    .mp-archive { padding: 24px 16px 60px; }
    .mp-archive__nav {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .mp-archive__subcats {
        gap: 18px;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .mp-archive__subcats::-webkit-scrollbar { display: none; }
    .mp-archive__subcat { white-space: nowrap; flex-shrink: 0; }
    .mp-archive__more-subcats { flex-shrink: 0; }
    .mp-archive__filter-btn { align-self: flex-end; }
}

/* ----- Grid (con MÁS aire entre productos) ----- */
.mp-archive__grid.mp-products-grid {
    gap: 24px 18px;
}
@media (max-width: 1024px) {
    .mp-archive__grid.mp-products-grid { gap: 20px 14px; }
}
@media (max-width: 768px) {
    .mp-archive__grid.mp-products-grid { gap: 18px 10px; }
}

.mp-archive .mp-product-card { position: relative; }

.mp-archive .mp-product-cart {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
    bottom: 14px;
    right: 14px;
}
.mp-archive .mp-product-cart:hover {
    background: #fff;
    transform: scale(1.05);
}

.mp-archive .mp-product-info { padding: 16px 4px 8px; }
.mp-archive .mp-product-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}
.mp-archive .mp-product-name { margin: 0; flex: 1; }

/* Mi botón visible (único que se ve) */
.mp-archive .mp-product-bookmark {
    background: transparent;
    border: none;
    color: #000;
    cursor: pointer;
    padding: 2px;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}
.mp-archive .mp-product-bookmark:hover { opacity: 1; }
.mp-archive .mp-product-bookmark.is-active svg { fill: #000; }
.mp-archive .mp-product-bookmark.is-active { opacity: 1; }

/* YITH renderizado: oculto visualmente pero accesible */
.mp-archive .mp-product-bookmark-yith {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

.mp-archive .mp-product-price {
    font-size: 0.85rem;
    color: #000;
}

.mp-archive .mp-product-badge--featured {
    background: #8B1A1A;
    color: #fff;
    top: 14px;
    right: auto;
    left: 14px;
    padding: 5px 12px;
    letter-spacing: 0.14em;
    font-size: 0.62rem;
}

/* ----- Paginación ----- */
.mp-archive__pagination {
    margin-top: 60px;
    text-align: center;
}
.mp-archive__pagination .page-numbers {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    justify-content: center;
}
.mp-archive__pagination .page-numbers li a,
.mp-archive__pagination .page-numbers li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-family: var(--mp-font-sans, sans-serif);
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
}
.mp-archive__pagination .page-numbers li a:hover { color: #000; }
.mp-archive__pagination .page-numbers li .current {
    color: #000;
    border-color: #000;
}

/* ----- Empty state ----- */
.mp-archive__empty {
    padding: 80px 24px;
    text-align: center;
    color: #666;
}
.mp-archive__empty-link {
    display: inline-block;
    margin-top: 14px;
    padding: 12px 26px;
    border: 1px solid #000;
    color: #000;
    font-family: var(--mp-font-sans, sans-serif);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s ease;
}
.mp-archive__empty-link:hover { background: #000; color: #fff; }

/* ================================================================
   FILTER DRAWER (lateral derecho)
   ================================================================ */
.mp-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 99996;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mp-filter-overlay.is-open { opacity: 1; pointer-events: auto; }

.mp-filter-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 460px;
    max-width: 100vw;
    background: #fff;
    z-index: 99997;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 24px rgba(0, 0, 0, 0.08);
}
.mp-filter-drawer.is-open { transform: translateX(0); }

.mp-filter-drawer__close {
    position: absolute;
    top: 24px; right: 26px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    z-index: 2;
}
.mp-filter-drawer__close:hover { opacity: 1; }

.mp-filter-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 70px 36px 28px;
}

.mp-filter-group { border-bottom: 1px solid #ececec; }
.mp-filter-group summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 0;
    font-family: var(--mp-font-sans, sans-serif);
    font-size: 0.86rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.mp-filter-group summary::-webkit-details-marker { display: none; }
.mp-filter-group__icon {
    font-size: 1.2rem;
    font-weight: 200;
    line-height: 1;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-filter-group[open] .mp-filter-group__icon { transform: rotate(45deg); }

.mp-filter-group__options {
    padding: 4px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
    font-family: var(--mp-font-sans, sans-serif);
    font-size: 0.88rem;
    color: #000;
}
.mp-filter-option__label { flex: 1; letter-spacing: 0.04em; }
.mp-filter-option__count { color: #aaa; font-size: 0.78rem; }
.mp-filter-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 2px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
}
.mp-filter-checkbox:checked { background: #000; border-color: #000; }
.mp-filter-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.mp-filter-drawer__footer {
    display: flex;
    border-top: 1px solid #ececec;
    padding: 20px 28px 24px;
    gap: 12px;
    background: #fff;
    flex-shrink: 0;
}
.mp-filter-btn {
    flex: 1;
    padding: 16px;
    font-family: var(--mp-font-sans, sans-serif);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid #000;
    transition: background 0.18s ease, color 0.18s ease;
    line-height: 1;
}
.mp-filter-btn--clear { background: #fff; color: #000; }
.mp-filter-btn--clear:hover { background: #f5f5f5; }
.mp-filter-btn--apply { background: #000; color: #fff; }
.mp-filter-btn--apply:hover { background: #1f1f1f; }

@media (max-width: 600px) {
    .mp-filter-drawer { width: 100vw; }
    .mp-filter-drawer__body { padding: 60px 22px 20px; }
    .mp-filter-drawer__footer { padding: 14px 18px 18px; }
}

body.mp-filter-open { overflow: hidden; }

/* ================================================================
   SUBCATS DRAWER (secundario, lateral derecho más angosto)
   ================================================================ */
.mp-subcats-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 99994;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mp-subcats-overlay.is-open { opacity: 1; pointer-events: auto; }

.mp-subcats-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 360px;
    max-width: 100vw;
    background: #fff;
    z-index: 99995;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 24px rgba(0, 0, 0, 0.08);
}
.mp-subcats-drawer.is-open { transform: translateX(0); }

.mp-subcats-drawer__header {
    padding: 24px 28px 18px;
    border-bottom: 1px solid #ececec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.mp-subcats-drawer__title {
    margin: 0;
    font-family: var(--mp-font-sans, sans-serif);
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.22em;
    color: #000;
}
.mp-subcats-drawer__close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 6px;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}
.mp-subcats-drawer__close:hover { opacity: 1; }

.mp-subcats-drawer__list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.mp-subcats-drawer__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    text-decoration: none;
    color: #333;
    font-family: var(--mp-font-sans, sans-serif);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    transition: background 0.15s ease, color 0.15s ease;
    border-bottom: 1px solid #f5f5f5;
}
.mp-subcats-drawer__link:hover {
    background: #fafafa;
    color: #000;
}
.mp-subcats-drawer__link.is-active {
    color: #000;
    font-weight: 500;
    background: #f7f5f3;
}
.mp-subcats-drawer__count {
    color: #aaa;
    font-size: 0.72rem;
    margin-left: 12px;
}

body.mp-subcats-open { overflow: hidden; }

@media (max-width: 600px) {
    .mp-subcats-drawer { width: 100vw; }
}
