/**
 * WooCommerce Custom Styles for SEAN Theme
 * Version 4.0 - Optimizado
 */

/* ================================
   OCULTAR WIDGETS NO DESEADOS
   ================================ */

.sean-sidebar-shop .widget_archive,
.sean-sidebar-shop .widget_categories,
.sean-shop-sidebar .widget_archive,
.sean-shop-sidebar .widget_categories {
    display: none !important;
}

/* ================================
   TIENDA - LAYOUT CON SIDEBAR
   ================================ */

.sean-shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.sean-shop-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.sean-shop-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sean-sidebar-shop {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.sean-sidebar-widget {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
}

.sean-sidebar-widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sean-sidebar-widget .widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2563eb;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* ================================
   BUSQUEDA
   ================================ */

.sean-search-widget {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin: -20px -20px 20px -20px;
    border-radius: 12px 12px 0 0;
}

.sean-search-form .search-input-wrapper {
    display: flex;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.sean-search-form .search-field {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.sean-search-form .search-submit {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
}

/* ================================
   ARBOL DE CATEGORIAS
   ================================ */

.sean-category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sean-category-tree .cat-item {
    border-bottom: 1px solid #f1f5f9;
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cat-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
}

.cat-link:hover {
    color: #2563eb;
}

.toggle-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.toggle-btn i {
    transition: transform 0.3s;
}

.cat-item.expanded .toggle-btn i {
    transform: rotate(90deg);
}

.subcategory-tree {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.cat-item.expanded .subcategory-tree {
    max-height: 500px;
}

.subcat-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 25px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
}

.subcat-link:hover {
    color: #2563eb;
}

/* ================================
   WIDGET DE MARCAS
   ================================ */

.sean-brands-widget.collapsed .brands-content {
    display: none;
}

.brands-search {
    position: relative;
    margin-bottom: 12px;
}

.brands-search-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.brands-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.brands-list-container {
    max-height: 300px;
    overflow-y: auto;
}

.brands-checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brand-item.hidden-brand {
    display: none;
}

.brand-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.brand-checkbox-label:hover {
    background: #f8fafc;
}

.brand-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.brand-name {
    flex: 1;
    font-size: 0.9rem;
}

.brand-count-badge {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

.show-more-brands {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: transparent;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
}

.brands-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.btn-filter-brands,
.btn-clear-brands {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-filter-brands {
    background: #2563eb;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-clear-brands {
    background: #f1f5f9;
    color: #64748b;
}

/* ================================
   FILTRO DE PRECIOS
   ================================ */

.price-range-form {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.price-inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.price-inputs span {
    color: #64748b;
    font-weight: 600;
}

.btn-price-filter {
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
}

.btn-clear-price {
    display: block;
    text-align: center;
    padding: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
}

.price-filter-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-filter-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.price-filter-link:hover {
    background: #eff6ff;
    color: #2563eb;
}

.price-filter-link.active {
    background: #2563eb;
    color: white;
}

/* ================================
   GRID DE PRODUCTOS
   ================================ */

.sean-shop-main .products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sean-shop-main .products::before,
.sean-shop-main .products::after {
    display: none !important;
}

.sean-shop-main .products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

/* ================================
   PAGINACION MODERNA
   ================================ */

.woocommerce-pagination {
    margin-top: 50px;
    text-align: center;
    display: flex;
    justify-content: center;
}

.woocommerce-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 6px;
    background: #f8fafc;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.woocommerce-pagination .page-numbers li {
    margin: 0;
}

.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Numeros de pagina */
.woocommerce-pagination .page-numbers li a {
    color: #64748b;
    background: white;
    border: 1px solid transparent;
}

.woocommerce-pagination .page-numbers li a:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Pagina actual */
.woocommerce-pagination .page-numbers li span.current {
    background: #2563eb;
    color: white;
    border: 1px solid #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Botones anterior/siguiente */
.woocommerce-pagination .page-numbers li a.prev,
.woocommerce-pagination .page-numbers li a.next {
    background: white;
    color: #2563eb;
    border: 1px solid #e2e8f0;
    font-weight: 700;
    min-width: 45px;
}

.woocommerce-pagination .page-numbers li a.prev:hover,
.woocommerce-pagination .page-numbers li a.next:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Iconos */
.woocommerce-pagination .page-numbers li a.prev::before {
    content: '‹';
    font-size: 1.2rem;
    margin-right: 2px;
}

.woocommerce-pagination .page-numbers li a.next::after {
    content: '›';
    font-size: 1.2rem;
    margin-left: 2px;
}

/* Puntos suspensivos */
.woocommerce-pagination .page-numbers li span.dots {
    color: #94a3b8;
    cursor: default;
    min-width: 30px;
}

/* Ocultar numeros grandes en paginacion (mostrar max 7 items) */
.woocommerce-pagination .page-numbers li:nth-child(n+8):not(:last-child):not(:nth-last-child(2)) {
    display: none !important;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {
    .sean-shop-main .products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .sean-shop-layout {
        flex-direction: column;
    }
    
    .sean-shop-sidebar {
        width: 100%;
        order: -1;
    }
    
    .sean-shop-main .products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .woocommerce-pagination .page-numbers {
        gap: 3px;
        padding: 4px;
    }
    
    .woocommerce-pagination .page-numbers li a,
    .woocommerce-pagination .page-numbers li span {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .sean-shop-main .products {
        grid-template-columns: 1fr !important;
    }
    
    .woocommerce-pagination .page-numbers li:nth-child(n+6):not(:last-child):not(:nth-last-child(2)) {
        display: none !important;
    }
}
