/* Enhanced Product List Styles for Liquid Theme */

/* Estilo para badge soldout - mesmo estilo que sale mas em preto */
.woocommerce ul.products li.product .ld-sp-soldout {
    background-color: #000;
    color: #fff;
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
    border-radius: 0px;
    top: 10px;
    left: 10px;
    z-index: 10;
}

/* Container principal para shortcode enhanced */
.ld-woo-products-enhanced {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 30px;
}

/* Sidebar de filtros */
.ld-woo-products-enhanced .filters-sidebar {
    flex: 0 0 300px;
    background: transparent;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

/* TÃ­tulo principal dos filtros */
.filters-sidebar::before {
    content: "";
    display: none;
}

.filters-sidebar-title {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #a0824f;
    margin-top: 0;
}

/* Ãrea principal com produtos */
.ld-woo-products-enhanced .products-main {
    flex: 1;
}

/* Remover limitaÃ§Ã£o de largura do container da loja */
.container {
    max-width: 100% !important;
    width: 100% !important;
}

/* Garantir que o conteÃºdo da loja ocupe toda a largura */
.lqd-shop-topbar-breadcrumb,
.lqd-shop-topbar-ajax-filter,
.lqd-shop-topbar-result-count {
    width: 100% !important;
    max-width: none !important;
}

/* Ajustar o grid de produtos para ocupar toda a largura */
.woocommerce ul.products {
    width: 100% !important;
    max-width: none !important;
}

/* Remover padding/margin desnecessÃ¡rios */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
    margin: 0 !important;
    padding: 0 !important;
}

/* ForÃ§ar largura total para elementos especÃ­ficos da loja */
.row {
    margin: 0 !important;
    width: 100% !important;
}

.col-md-6,
.col-md-3 {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
}

/* Mostrar apenas breadcrumb e ordenação, esconder filtros e contador */
.ld-shop-topbar,
.ld-shop-topbar.pos-rel,
.ld-shop-topbar.fullwidth {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mostrar container e row da barra */
.ld-shop-topbar .container,
.ld-shop-topbar .row {
    display: flex !important;
    visibility: visible !important;
}

/* Esconder o botÃ£o de filtros */
.lqd-shop-topbar-ajax-filter {
    display: none !important;
}

/* Esconder o contador de resultados, mas manter o formulário de ordenação */
.lqd-shop-topbar-result-count .woocommerce-result-count {
    display: none !important;
}

/* Mostrar apenas o formulário de ordenação */
.lqd-shop-topbar-result-count .woocommerce-ordering {
    display: block !important;
}

/* Ajustar o layout da barra superior da loja */
.lqd-shop-topbar-breadcrumb {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    display: block !important;
    visibility: visible !important;
}

.lqd-shop-topbar-result-count {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    visibility: visible !important;
}

/* Garantir que o conteÃºdo dos produtos ocupe toda a largura */
.woocommerce-page .woocommerce {
    width: 100% !important;
    max-width: none !important;
}

/* Ajustar o grid de produtos */
.woocommerce ul.products li.product {
    width: calc(25% - 20px) !important;
    margin: 10px !important;
}

/* Esconder botão de filtros acima de 1200px */
.filters-toggle-btn {
    display: none;
}

@media (max-width: 1200px) {
    .woocommerce ul.products li.product {
        width: calc(33.333% - 20px) !important;
    }
    
    /* Botão para abrir/fechar filtros */
    .filters-toggle-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        background: #a0824f;
        color: white;
        border: none;
        cursor: pointer;
        font-size: 16px;
        font-weight: 600;
        border-radius: 0;
        margin-bottom: 20px;
        width: 100%;
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: 9999;
    }
    
    /* Layout ajustado abaixo de 1200px */
    .ld-woo-products-enhanced {
        flex-direction: column;
    }
    
    .ld-woo-products-enhanced .products-main {
        width: 100%;
        order: 1;
    }
    
    .filters-toggle-btn:hover {
        background: #8a7344;
    }
    
    .filters-toggle-btn::before {
        content: '☰';
        font-size: 20px;
    }
    
    .filters-toggle-btn.active::before {
        content: '✕';
    }
    
    /* Esconder sidebar de filtros */
    .ld-woo-products-enhanced .filters-sidebar {
        display: none !important;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 100%;
        height: 100%;
        overflow-y: auto;
        z-index: 10000;
        transition: right 0.3s ease;
    }
    
    .ld-woo-products-enhanced .filters-sidebar.show {
        display: block !important;
        right: 0;
    }
    
    .ld-woo-products-enhanced {
        position: relative;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        width: calc(50% - 20px) !important;
    }
    
    .lqd-shop-topbar-breadcrumb {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .lqd-shop-topbar-ajax-filter {
        display: none !important;
    }
    
    .lqd-shop-topbar-result-count {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        display: flex !important;
        justify-content: flex-end !important;
    }
    
    .lqd-shop-topbar-result-count .woocommerce-result-count {
        display: none !important;
    }
    
    .lqd-shop-topbar-result-count .woocommerce-ordering {
        display: block !important;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products li.product {
        width: calc(100% - 20px) !important;
    }
    
    .lqd-shop-topbar-breadcrumb {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 15px;
    }
    
    .lqd-shop-topbar-ajax-filter {
        display: none !important;
    }
    
    .lqd-shop-topbar-result-count {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
    }
    
    .lqd-shop-topbar-result-count .woocommerce-result-count {
        display: none !important;
    }
    
    .lqd-shop-topbar-result-count .woocommerce-ordering {
        display: block !important;
    }
}

/* Breadcrumbs */
.ld-woo-products-enhanced .products-breadcrumbs {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.woocommerce-breadcrumb {
    font-size: 14px;
    color: #666;
}

.woocommerce-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
    text-decoration: underline;
}

/* OpÃ§Ãµes de ordenaÃ§Ã£o */
.ld-woo-products-enhanced .products-sorting-wrapper {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.products-sorting {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sorting-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sorting-form select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    min-width: 180px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sorting-form select:hover {
    border-color: #0073aa;
}

.sorting-form select:focus {
    outline: none;
    border-color: #0073aa;
}

/* Contador de produtos */
.products-count {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* PaginaÃ§Ã£o */
.ld-woo-products-enhanced .products-pagination {
    text-align: center;
    margin: 40px 0;
}

.products-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 3px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #333;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.products-pagination .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.products-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.products-pagination .page-numbers.prev,
.products-pagination .page-numbers.next {
    font-weight: 600;
}

/* IntegraÃ§Ã£o com o grid do Liquid */
.ld-woo-products-enhanced .ld-products-list {
    margin-bottom: 40px;
}

/* Responsividade */
@media (max-width: 768px) {
    .ld-woo-products-enhanced .products-sorting-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ld-woo-products-enhanced .products-sorting {
        justify-content: center;
    }
    .woocommerce ul.products li.product .ld-sp-info h3 a{
        font-weight: 600 !important; /* menos grosso */
        font-size: 16px !important;  /* mais pequeno */
        line-height: 1.2 !important;
    }
    .woocommerce .ld-sp .ld-sp-info {
        text-align: start;
    }
    .woocommerce ul.products li.product .button{
        display: none;
    }
    .woocommerce .ld-sp figure {
        margin-bottom: 10px !important;
        overflow: hidden;
    }
}

/* Estilos para os filtros na sidebar */
.filters-sidebar .brand-filter-wrapper,
.filters-sidebar .category-filter-wrapper,
.filters-sidebar .price-filter-wrapper,
.filters-sidebar .stock-filter-wrapper {
    padding: 0;
    background: transparent;
    border: none;
    padding-bottom: 20px;
}

.filters-sidebar .brand-filter-wrapper:last-child,
.filters-sidebar .category-filter-wrapper:last-child,
.filters-sidebar .price-filter-wrapper:last-child,
.filters-sidebar .stock-filter-wrapper:last-child {
    margin-bottom: 0;
}

/* TÃ­tulos dos filtros */
.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #a0824f;
    border-radius: 0;
    transition: all 0.3s ease;
}

/* TÃ­tulos clicÃ¡veis para expandir/encolher */
.filter-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    padding: 8px 0 12px;
    font-weight: 600;
    color: #000;
}

.filter-toggle:hover {
    color: #a0824f;
}

.filter-toggle.expanded {
    color: #000;
    font-weight: 600;
    font-size: 14px;
}

/* Border bottom reduzido quando expandido */
.filter-toggle.expanded .filter-title {
    border-bottom-width: 1px;
    border-bottom-color: #a0824f;
}

/* Ãcone de expansÃ£o/colapso */
.toggle-icon {
    font-size: 20px;
    font-weight: 500;
    color: #000;
    transition: all 0.3s ease;
    min-width: 20px;
    text-align: center;
}

/* Icon removed - using HTML content instead */

.filter-toggle:hover .toggle-icon {
    color: #a0824f;
}

.filter-toggle.expanded .toggle-icon {
    color: #000;
    font-weight: 500;
}

/* ConteÃºdo dos filtros */
.filter-content {
    display: block;
}

.filter-content.hidden {
    display: none;
}

/* FormulÃ¡rios dos filtros na sidebar */
.filters-sidebar .brand-filter-form,
.filters-sidebar .category-filter-form,
.filters-sidebar .price-filter-form,
.filters-sidebar .stock-filter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

/* Lista de checkboxes */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Labels dos checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    color: #000;
}

.checkbox-label:hover {
    background: transparent;
    color: #a0824f;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #a0824f;
    cursor: pointer;
}

.checkbox-text {
    flex: 1;
    user-select: none;
}

/* Checkbox customizado */
.checkbox-label input[type="checkbox"]:checked + .checkbox-text,
.checkbox-label input[type="radio"]:checked + .checkbox-text {
    color: #a0824f;
    font-weight: 500;
}

/* FormulÃ¡rios dos filtros fora da sidebar (fallback) */
.brand-filter-form,
.category-filter-form,
.price-filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Labels dos filtros */
.brand-filter-form label,
.category-filter-form label,
.price-filter-form label {
    font-weight: 600;
    color: #000;
    font-size: 14px;
    margin: 0 0 8px 0;
    white-space: nowrap;
}

.filters-sidebar .brand-filter-form label,
.filters-sidebar .category-filter-form label,
.filters-sidebar .price-filter-form label {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: #000;
}

/* Selects dos filtros */
.brand-filter-form select,
.category-filter-form select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    min-width: 200px;
    font-weight: 500;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.filters-sidebar .brand-filter-form select,
.filters-sidebar .category-filter-form select {
    min-width: auto;
    width: 100%;
}

.brand-filter-form select:hover,
.category-filter-form select:hover {
    border-color: #a0824f;
}

.brand-filter-form select:focus,
.category-filter-form select:focus {
    outline: none;
    border-color: #a0824f;
}

/* Estilos especÃ­ficos para filtro de preÃ§o com slider */
.price-slider-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-display {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    padding: 5px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.slider-wrapper {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

.price-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

#price-max-slider.price-slider {
    height: 0px;
}

/* Garantir que ambos os sliders fiquem por cima da barra */
#price-min-slider {
    z-index: 10 !important;
}

#price-max-slider {
    z-index: 11 !important;
}

/* Quando o slider mínimo está à direita do máximo, ele deve ficar por cima */
#price-min-slider:focus {
    z-index: 12 !important;
}

#price-max-slider:focus {
    z-index: 12 !important;
}

/* Diferenciação visual dos sliders */
#price-min-slider::-webkit-slider-thumb {
    background: #a0824f;
    border: 2px solid #fff;
    width: 24px;
    height: 8px;
    border-radius: 2px;
}

#price-max-slider::-webkit-slider-thumb {
    background: #8a6d42;
    border: 2px solid #fff;
    width: 24px;
    height: 8px;
    border-radius: 2px;
}

#price-min-slider::-moz-range-thumb {
    background: #a0824f;
    border: 2px solid #fff;
    width: 24px;
    height: 8px;
    border-radius: 2px;
}

#price-max-slider::-moz-range-thumb {
    background: #8a6d42;
    border: 2px solid #fff;
    width: 24px;
    height: 8px;
    border-radius: 2px;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 8px;
    border-radius: 2px;
    background: #a0824f;
    cursor: pointer;
    border: 2px solid #fff;
    position: relative;
    z-index: 10;
}

.price-slider::-moz-range-thumb {
    width: 24px;
    height: 8px;
    border-radius: 2px;
    background: #a0824f;
    cursor: pointer;
    border: 2px solid #fff;
    position: relative;
    z-index: 10;
}

.price-slider::-webkit-slider-track {
    background: #e9ecef;
    height: 6px;
    border-radius: 3px;
    cursor: default;
    pointer-events: none;
}

.price-slider::-moz-range-track {
    background: #e9ecef;
    height: 6px;
    border-radius: 3px;
    border: none;
    cursor: default;
    pointer-events: none;
}

/* Remover barra do slider máximo */
#price-max-slider::-webkit-slider-track {
    background: transparent;
    height: 0;
    border-radius: 0;
}

#price-max-slider::-moz-range-track {
    background: transparent;
    height: 0;
    border-radius: 0;
    border: none;
}

/* Desabilitar clique na barra, apenas nos retângulos */
.price-slider {
    cursor: default;
    pointer-events: none;
}

.price-slider::-webkit-slider-thumb {
    pointer-events: auto;
    cursor: grab;
}

.price-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.price-slider::-moz-range-thumb {
    pointer-events: auto;
    cursor: grab;
}

.price-slider::-moz-range-thumb:active {
    cursor: grabbing;
}

/* Desabilitar clique na track */
.price-slider::-webkit-slider-track {
    pointer-events: none;
}

.price-slider::-moz-range-track {
    pointer-events: none;
}

/* Estilos especÃ­ficos para filtro de preÃ§o (fallback) */
.price-range-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters-sidebar .price-range-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.price-range-container input[type="number"] {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    width: 100px;
    text-align: center;
    color: #000;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filters-sidebar .price-range-container input[type="number"] {
    width: 100%;
}

.price-range-container input[type="number"]:hover {
    border-color: #a0824f;
}

.price-range-container input[type="number"]:focus {
    outline: none;
    border-color: #a0824f;
}

.price-separator {
    font-weight: 600;
    color: #a0824f;
    font-size: 16px;
}

.filters-sidebar .price-separator {
    display: none;
}

.price-filter-button {
    padding: 12px 20px;
    background: #a0824f;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.filters-sidebar .price-filter-button {
    width: 100%;
}

.price-filter-button:hover {
    background: #8a6d42;
    transform: translateY(-1px);
}

/* Responsividade dos filtros */
@media (max-width: 1200px) {
    .ld-woo-products-enhanced {
        flex-direction: column;
        gap: 20px;
    }
    
    .ld-woo-products-enhanced .filters-sidebar {
        flex: none;
        position: static;
        order: 1;
    }
    
    .ld-woo-products-enhanced .products-main {
        order: 2;
    }
    
    /* Filtros sempre visíveis no mobile também */
    
    .brand-filter-form,
    .category-filter-form,
    .price-filter-form,
    .stock-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .brand-filter-form label,
    .category-filter-form label,
    .price-filter-form label,
    .stock-filter-form label {
        text-align: left;
    }
    
    .brand-filter-form select,
    .category-filter-form select {
        width: 100%;
        min-width: auto;
    }
    
    .price-range-container {
        justify-content: center;
    }
    
    .price-range-container input[type="number"] {
        width: 80px;
    }
    
    .checkbox-label {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    /* Garantir pelo menos 2 colunas de produtos no mobile */
    .woocommerce ul.products li.product {
        width: calc(50% - 10px) !important;
        margin: 5px !important;
    }
    
    /* Ajustar grid de produtos para mobile */
    .woocommerce ul.products {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
}

/* Botão limpar filtros */
.clear-filters-wrapper {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.clear-filters-btn {
    width: 100%;
    color: #000;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid #a0824f;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.clear-filters-btn:hover {
    background: #a0824f;
    color: #fff;
    border-color: #a0824f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(160, 130, 79, 0.3);
}

.clear-filters-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(160, 130, 79, 0.3);
}

.clear-filters-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(160, 130, 79, 0.3);
}
