/**
 * Estilos para páginas de tienda (shop, categorías, archivos)
 * 
 * @package YeshuaTech
 */

/* Contenedor principal de la tienda */
.woocommerce-page.archive-page {
    background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
    min-height: 100vh;
}

/* Header de la página de tienda */
.woocommerce-page.archive-page header {
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 30%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Títulos de página */
.woocommerce-page.archive-page h1 {
    font-family: 'Arimo', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar de filtros */
.woocommerce-page.archive-page aside {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.woocommerce-page.archive-page aside:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Títulos de sección en filtros */
.woocommerce-page.archive-page aside h3,
.woocommerce-page.archive-page aside h4 {
    font-family: 'Arimo', sans-serif;
    font-weight: 600;
    color: #1f2937;
}

/* Enlaces de categorías en filtros */
.woocommerce-page.archive-page aside a {
    transition: all 0.2s ease;
    border-radius: 0.5rem;
}

.woocommerce-page.archive-page aside a:hover {
    transform: translateX(4px);
}

/* Barra superior de ordenamiento */
.woocommerce-page.archive-page .woocommerce-ordering {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.woocommerce-page.archive-page .woocommerce-ordering select {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    transition: all 0.2s ease;
}

.woocommerce-page.archive-page .woocommerce-ordering select:hover {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.woocommerce-page.archive-page .woocommerce-ordering select:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Grid de productos - FORZAR 3 COLUMNAS HORIZONTALES */
.woocommerce-page.archive-page ul.products {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
}

@media (min-width: 1024px) {
    .woocommerce-page.archive-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

.woocommerce-page.archive-page ul.products li.product {
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100% !important;
    float: none !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    height: 100%;
}

.woocommerce-page.archive-page ul.products li.product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #f59e0b;
}

/* Asegurar que las tarjetas tengan altura uniforme */
.woocommerce-page.archive-page ul.products {
    align-items: stretch;
}

.woocommerce-page.archive-page ul.products li.product > div {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.woocommerce-page.archive-page ul.products li.product a {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

/* Optimizar proporciones de imagen */
.woocommerce-page.archive-page ul.products li.product .aspect-square {
    aspect-ratio: 1 / 1;
    max-height: 280px;
}

@media (min-width: 1024px) {
    .woocommerce-page.archive-page ul.products li.product .aspect-square {
        max-height: 320px;
    }
}

/* Compactar información del producto */
.woocommerce-page.archive-page ul.products li.product h3 {
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

.woocommerce-page.archive-page ul.products li.product .text-lg {
    font-size: 1rem;
    line-height: 1.2;
}

/* Botón más compacto */
.woocommerce-page.archive-page ul.products li.product .yeshua-btn-add-to-cart {
    font-size: 0.75rem;
    padding: 0.625rem 1rem;
    min-height: 36px;
}

@media (min-width: 1024px) {
    .woocommerce-page.archive-page ul.products li.product .yeshua-btn-add-to-cart {
        font-size: 0.8125rem;
        padding: 0.75rem 1.25rem;
        min-height: 40px;
    }
}

/* Eliminar cualquier estilo de WooCommerce que fuerce layout vertical */
.woocommerce-page.archive-page ul.products.columns-1,
.woocommerce-page.archive-page ul.products.columns-2,
.woocommerce-page.archive-page ul.products.columns-3,
.woocommerce-page.archive-page ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

@media (min-width: 1024px) {
    .woocommerce-page.archive-page ul.products.columns-1,
    .woocommerce-page.archive-page ul.products.columns-2,
    .woocommerce-page.archive-page ul.products.columns-3,
    .woocommerce-page.archive-page ul.products.columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Botón de filtros móvil */
#mobile-filters-toggle {
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    color: #1f2937;
    font-weight: 600;
    transition: all 0.3s ease;
}

#mobile-filters-toggle:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #d97706;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Drawer de filtros móvil */
#mobile-filters-overlay {
    z-index: 9999;
}

#mobile-filters-drawer {
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

/* Mensaje de "No se encontraron productos" */
.woocommerce-page.archive-page .woocommerce-info,
.woocommerce-page.archive-page .woocommerce-no-products-found {
    text-align: center;
    padding: 3rem 1rem;
    background: #ffffff;
    border-radius: 1.5rem;
    border: 2px solid #f3f4f6;
}

/* Paginación */
.woocommerce-page.archive-page .woocommerce-pagination {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.woocommerce-page.archive-page .woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-page.archive-page .woocommerce-pagination ul li {
    margin: 0;
    padding: 0;
}

.woocommerce-page.archive-page .woocommerce-pagination ul li a,
.woocommerce-page.archive-page .woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.woocommerce-page.archive-page .woocommerce-pagination ul li a:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2);
}

.woocommerce-page.archive-page .woocommerce-pagination ul li span.current {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-color: #f59e0b;
    font-weight: 600;
}

/* Breadcrumbs - Alineado con el título */
.woocommerce-page.archive-page header .woocommerce-breadcrumb {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
    padding: 0;
    line-height: 1.5;
}

.woocommerce-page.archive-page header .woocommerce-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.woocommerce-page.archive-page header .woocommerce-breadcrumb a:hover {
    color: #f59e0b;
}

.woocommerce-page.archive-page header .woocommerce-breadcrumb .breadcrumb-separator {
    margin: 0 0.5rem;
    color: #d1d5db;
    font-weight: 400;
}

.woocommerce-page.archive-page header .woocommerce-breadcrumb span {
    color: #9ca3af;
    font-weight: 500;
}

/* Range slider de precio */
.woocommerce-page.archive-page .price-range-slider {
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    height: 6px;
    border-radius: 5px;
    outline: none;
    transition: background 0.3s ease;
}

.woocommerce-page.archive-page .price-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.woocommerce-page.archive-page .price-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.woocommerce-page.archive-page .price-range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.woocommerce-page.archive-page .price-range-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.woocommerce-page.archive-page .price-range-slider:focus {
    outline: none;
}

.woocommerce-page.archive-page .price-range-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.woocommerce-page.archive-page aside form button[type="submit"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.woocommerce-page.archive-page aside form button[type="submit"]:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Responsive */
@media (max-width: 767px) {
    .woocommerce-page.archive-page header {
        padding: 1.5rem 1rem;
    }
    
    .woocommerce-page.archive-page h1 {
        font-size: 1.75rem;
    }
    
    .woocommerce-page.archive-page ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Asegurar que no haya floats que rompan el grid */
.woocommerce-page.archive-page ul.products::before,
.woocommerce-page.archive-page ul.products::after {
    display: none !important;
    content: none !important;
}

/* Forzar que los productos no tengan display inline-block o float */
.woocommerce-page.archive-page ul.products li.product::before,
.woocommerce-page.archive-page ul.products li.product::after {
    display: none !important;
    content: none !important;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.woocommerce-page.archive-page ul.products li.product {
    animation: fadeInUp 0.5s ease-out;
}

.woocommerce-page.archive-page ul.products li.product:nth-child(1) { animation-delay: 0.05s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(2) { animation-delay: 0.1s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(3) { animation-delay: 0.15s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(4) { animation-delay: 0.2s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(5) { animation-delay: 0.25s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(6) { animation-delay: 0.3s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(7) { animation-delay: 0.35s; }
.woocommerce-page.archive-page ul.products li.product:nth-child(8) { animation-delay: 0.4s; }

