/* =========================
   RESET CONTRA EL THEME
========================= */

.csw-layout a,
.csw-layout a:hover,
.csw-layout a:focus,
.csw-layout a:active {
    text-decoration: none !important;
    color: inherit !important;
}

/* =========================
   LAYOUT
========================= */

.csw-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    font-family: 'Poppins', sans-serif;
}

/* =========================
   FILTRO
========================= */

.csw-filters {
    width: 280px;
    padding: 25px;
    border-radius: 14px;
    background: transparent;
    border: 1px solid #0000001A;
}

.csw-filter-title {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    line-height: 28px !important;
    letter-spacing: 0% !important;
    color: #000 !important;
    margin-bottom: 25px;
}

/* Padre */

.csw-parent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.csw-parent-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #000 !important;
    padding: 0;
    margin: 0;
}

/* Flecha dinámica */

.csw-toggle {
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s ease;
}

.csw-toggle::before {
    content: ">";
}

.csw-toggle.open::before {
    content: "⌵";
}

/* Hijas */

.csw-children {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.csw-children li {
    margin-bottom: 8px;
}

.csw-children a {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #1D1D1D99 !important;
    display: block;
}

/* =========================
   FIX ALINEACIÓN
========================= */

.csw-filters ul {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.csw-filter-group {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.csw-children a,
.csw-parent-link {
    display: block;
}

/* =========================
   PRODUCTOS
========================= */

.csw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

.csw-card {
    display: block;
    background: #FFFFFF;
    padding: 25px;
    border-radius: 18px;
    transition: 0.2s ease;
}

.csw-card:hover {
    transform: translateY(-4px);
}

.csw-product-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: 0%;
    margin-bottom: 10px;
    color: #000 !important;
}

.csw-product-desc {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 15px;
    color: #555 !important;
}

.price {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #000 !important;
}

/* =========================
   PAGINACIÓN
========================= */

.csw-pagination {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.csw-page-btn {
    width: 115px;
    height: 37px;
    border-radius: 8px;
    border: 1px solid #0000001A;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #000 !important;
    text-decoration: none !important;
}

.csw-page-numbers {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.csw-page-number {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    text-align: center;
    color: #000 !important;
    text-decoration: none !important;
}

.csw-page-number.active {
    font-weight: 600;
}

/* =========================
   TITULO CATEGORIA
========================= */

.csw-products-title,
.woocommerce-products-header__title,
.page-title {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    line-height: 28px !important;
    letter-spacing: 0% !important;
    color: #000 !important;
    margin-bottom: 25px;
}

/* =========================
   PRODUCTS HEADER
========================= */

.csw-products-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.csw-current-category {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    line-height: 28px !important;
    color: #000 !important;
    margin: 0;
}

.csw-products-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.csw-showing {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #000;
    flex: 1;
}

/* =========================
   ORDER DROPDOWN
========================= */

.csw-order-wrapper {
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.csw-order-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.csw-order-arrow::before {
    content: ">";
    font-size: 14px;
    transition: 0.2s ease;
}

.csw-order-arrow.open::before {
    content: "⌵";
}

.csw-order-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    background: #fff;
    border: 1px solid #0000001A;
    border-radius: 8px;
    padding: 10px;
    min-width: 180px;
    z-index: 10;
}

.csw-order-dropdown a {
    display: block;
    padding: 6px 8px;
    font-size: 14px;
    font-weight: 400;
    color: #000 !important;
}

.csw-order-dropdown a:hover {
    background: #f5f5f5;
}

/* =========================
   MOBILE: BOTÓN COMPACTO
   (oculto en desktop)
========================= */

.csw-mobile-filter-btn-wrap {
    display: none;
}

.csw-mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #0000001A;
    border-radius: 10px;
    padding: 10px 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #000;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* =========================
   MOBILE: OVERLAY
========================= */

.csw-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.csw-drawer-overlay.csw-visible {
    display: block;
    opacity: 1;
}

/* =========================
   MOBILE: DRAWER (off-canvas)
========================= */

.csw-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 360px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.csw-drawer.csw-open {
    transform: translateX(0);
}

.csw-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #eee;
}

.csw-drawer-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #000;
}

.csw-drawer-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #000;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.csw-drawer-close:hover {
    background: #f0f0f0;
}

.csw-drawer-content {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

/* Estilos de categorías dentro del drawer */
.csw-drawer-content .csw-filter-group {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.csw-drawer-content .csw-parent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.csw-drawer-content .csw-parent-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #000 !important;
}

.csw-drawer-content .csw-children {
    display: none;
    list-style: none;
    padding: 6px 0 6px 12px !important;
    margin: 0 !important;
}

.csw-drawer-content .csw-children li {
    margin-bottom: 6px;
}

.csw-drawer-content .csw-children a {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #444 !important;
    display: block;
    padding: 4px 0;
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 768px) {

    /* Ocultar sidebar desktop */
    .csw-filters {
        display: none !important;
    }

    /* Mostrar botón compacto */
    .csw-mobile-filter-btn-wrap {
        display: block;
        margin-bottom: 18px;
    }

    .csw-layout {
        display: block;
        padding: 0 16px;
        gap: 0;
    }

    .csw-products-top {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
    }

    .csw-products-meta {
        width: auto;
    }

    .csw-grid {
        display: flex;
        flex-direction: column;
        gap: 35px;
    }

    .csw-card {
        background: transparent;
        background-color: transparent;
        border: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .csw-card:hover {
        transform: none;
    }

    .csw-card img {
        width: 140px !important;
        height: auto;
        display: block;
        margin: 0 auto 15px;
    }

    .csw-product-title {
        font-size: 22px !important;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .csw-product-desc {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .price {
        font-size: 18px !important;
        display: block;
        margin-bottom: 15px;
    }

    .csw-card .button,
    .csw-card .add_to_cart_button,
    .csw-card a.button {
        width: 100%;
        background: #000 !important;
        color: #fff !important;
        border-radius: 30px !important;
        text-align: center;
        padding: 14px 20px !important;
        font-size: 14px;
    }

    .csw-pagination {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    .csw-pagination .csw-page-numbers {
        display: none !important;
    }
}

/* En desktop el drawer nunca es visible */
@media (min-width: 769px) {
    .csw-drawer,
    .csw-drawer-overlay,
    .csw-mobile-filter-btn-wrap {
        display: none !important;
    }
}

/* =========================
   OCULTAR TÍTULO DE PÁGINA
   Solo en páginas con el shortcode
========================= */

.csw-active-page .entry-title,
.csw-active-page .page-title,
.csw-active-page h1.page-title,
.csw-active-page h1.entry-title,
.csw-active-page .page-header,
.csw-active-page .woocommerce-products-header,
.csw-active-page .woocommerce-products-header__title {
    display: none !important;
}
