/* ============================================
   H8 WooCommerce - Product Listing (Telas 1-2)
   ============================================ */

/* Category filter tags row */
.h8-wrap .h8-filter-tags-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 24px;
}

.h8-wrap .h8-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1;
}

.h8-wrap .h8-filter-tags .h8-filter-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: 1.5px solid var(--h8-gray-200);
    border-radius: var(--h8-radius-pill);
    background: var(--h8-white);
    color: #0631A5;
    cursor: pointer;
    transition: all var(--h8-transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--h8-font);
    line-height: 1.2;
    height: 40px;
}

.h8-wrap .h8-filter-tags .h8-filter-tag:hover,
.h8-wrap .h8-filter-tags .h8-filter-tag.active {
    background: var(--h8-primary);
    color: var(--h8-white);
    border-color: var(--h8-primary);
}

/* Filter toggle button (icon only) */
.h8-wrap .h8-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--h8-gray-200);
    border-radius: var(--h8-radius);
    background: var(--h8-white);
    cursor: pointer;
    color: #0631A5;
    transition: all var(--h8-transition);
    flex-shrink: 0;
    padding: 0;
}

.h8-wrap .h8-filter-toggle:hover {
    border-color: var(--h8-primary);
    background: var(--h8-primary);
    color: var(--h8-white);
}

.h8-wrap .h8-filter-toggle svg {
    width: 24px;
    height: 24px;
}

/* Listing layout container */
.h8-listing-layout {
    display: flex;
    gap: 24px;
    position: relative;
}

/* Filter Sidebar */
.h8-filter-sidebar {
    width: 307px;
    min-width: 307px;
    background: var(--h8-white);
    padding: 0 24px 24px 0;
    display: none;
    flex-shrink: 0;
}

.h8-filter-sidebar.open {
    display: block;
}

/* Filter sidebar header */
.h8-filter-sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 20px !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.h8-filter-sidebar-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--h8-gray-800) !important;
    font-family: var(--h8-font) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.h8-filter-sidebar-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    border: 1px solid var(--h8-gray-200) !important;
    border-radius: var(--h8-radius) !important;
    background: var(--h8-white) !important;
    cursor: pointer !important;
    color: var(--h8-gray-700) !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: all var(--h8-transition) !important;
}

.h8-filter-sidebar-close:hover {
    border-color: var(--h8-primary) !important;
    color: var(--h8-primary) !important;
}

.h8-filter-sidebar-close svg {
    width: 24px !important;
    height: 24px !important;
}

.h8-filter-group {
    margin-bottom: 20px;
}

.h8-filter-group-bordered {
    padding-bottom: 20px !important;
    border-bottom: 1px solid var(--h8-gray-200) !important;
}

.h8-filter-group-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--h8-gray-800);
    margin-bottom: 16px;
    font-family: var(--h8-font);
}

/* Custom checkboxes */
.h8-wrap .h8-filter-option {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--h8-gray-800) !important;
    font-family: var(--h8-font) !important;
    line-height: 1.4 !important;
}

.h8-wrap .h8-filter-option input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    border: 1.5px solid var(--h8-gray-200) !important;
    border-radius: 6px !important;
    background: var(--h8-white) !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all var(--h8-transition) !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.h8-wrap .h8-filter-option input[type="checkbox"]:hover {
    border-color: var(--h8-primary) !important;
}

.h8-wrap .h8-filter-option input[type="checkbox"]:checked {
    background: var(--h8-primary) !important;
    border-color: var(--h8-primary) !important;
}

.h8-wrap .h8-filter-option input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    top: 4px !important;
    left: 8px !important;
    width: 6px !important;
    height: 11px !important;
    border: solid var(--h8-white) !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

/* Color filter chips (2-column grid) */
.h8-wrap .h8-color-chips {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
}

.h8-wrap .h8-color-chip {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    background: var(--h8-white) !important;
    border: 1px solid #D9D9D7 !important;
    border-radius: 48px !important;
    cursor: pointer !important;
    transition: all var(--h8-transition) !important;
    font-family: var(--h8-font) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--h8-gray-800) !important;
    white-space: nowrap !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.h8-wrap .h8-color-chip:hover {
    border-color: var(--h8-gray-500) !important;
}

.h8-wrap .h8-color-chip.selected {
    border-color: var(--h8-primary) !important;
    background: var(--h8-white) !important;
}

.h8-wrap .h8-color-chip .h8-color-dot {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}

.h8-wrap .h8-color-chip .h8-color-chip-count {
    color: var(--h8-gray-500) !important;
    font-weight: 400 !important;
}

/* Apply filter button */
.h8-wrap .h8-filter-sidebar .h8-filter-apply {
    display: block !important;
    margin-top: 24px !important;
    width: 100% !important;
    padding: 13px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: var(--h8-font) !important;
    background: var(--h8-primary) !important;
    color: var(--h8-white) !important;
    border: none !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    transition: background var(--h8-transition) !important;
    text-align: center !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.h8-wrap .h8-filter-sidebar .h8-filter-apply:hover {
    background: var(--h8-primary-dark) !important;
}

/* Product Grid */
.h8-products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Product Card */
.h8-product-card {
    background: var(--h8-gray-50);
    border: none;
    border-radius: var(--h8-radius-lg);
    overflow: hidden;
    transition: box-shadow var(--h8-transition);
    position: relative;
}

.h8-product-card:hover {
    box-shadow: var(--h8-shadow-md);
}

/* Unavailable product overlay */
.h8-product-card.unavailable .h8-product-image-wrap {
    position: relative;
}

.h8-product-card.unavailable .h8-product-image-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--h8-overlay);
    z-index: 2;
}

.h8-product-unavailable-badge {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
}

.h8-product-card.unavailable .h8-product-unavailable-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.h8-lock-icon {
    width: 48px;
    height: 48px;
}

.h8-unavailable-text {
    color: var(--h8-white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product image */
.h8-product-image-wrap {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: transparent;
}

.h8-product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.h8-wrap .h8-product-card .h8-product-code {
    position: absolute !important;
    top: 15px !important;
    left: 12px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: var(--h8-gray-500) !important;
    background: #ffffff !important;
    border: 1px solid #D9D9D7 !important;
    border-radius: 48px !important;
    padding: 8px 16px !important;
    line-height: 1.2 !important;
    z-index: 1 !important;
    font-family: var(--h8-font) !important;
}

/* Product info */
.h8-product-info {
    padding: 16px 21px 21px;
}

.h8-product-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--h8-gray-800);
    margin-bottom: 28px;
    line-height: 1.4;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.h8-product-name a {
    color: inherit;
    text-decoration: none;
}

.h8-product-name a:hover {
    color: var(--h8-primary);
}

.h8-product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.h8-wrap .h8-product-card .h8-product-cart-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--h8-white) !important;
    border: 1px solid var(--h8-gray-200) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all var(--h8-transition) !important;
    color: #0631A5 !important;
    padding: 8px !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.h8-wrap .h8-product-card .h8-product-cart-btn:hover {
    background: var(--h8-primary) !important;
    color: var(--h8-white) !important;
    border-color: var(--h8-primary) !important;
}

.h8-wrap .h8-product-card .h8-product-cart-btn svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
}

.h8-product-card.unavailable .h8-product-actions {
    opacity: 0.4;
    pointer-events: none;
}

/* Hide unavailable products when filter sidebar is open */
.h8-product-card.h8-hidden-by-filter {
    display: none !important;
}

/* Pagination */
.h8-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
}

.h8-pagination a,
.h8-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--h8-gray-200);
    border-radius: var(--h8-radius);
    font-size: 14px;
    color: var(--h8-gray-700);
    text-decoration: none;
    transition: all var(--h8-transition);
}

.h8-pagination a:hover,
.h8-pagination .current {
    background: var(--h8-primary);
    color: var(--h8-white);
    border-color: var(--h8-primary);
}

/* No products */
.h8-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--h8-gray-500);
    font-size: 16px;
}
