.products-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.products-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.products-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.products-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.products-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }
.products-grid li {
    list-style: none;
    .woocommerce-loop-product__title {
        font-size: clamp(1.1rem, 1.5vw, 1.5rem);
        margin: 1rem 0;
    }
}

.product-item {
    position: relative;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
}

.product-title-wrap h2 {
    margin: 0;
    flex: 1;
    font-size: 1.1em;
}

.woocommerce-loop-product__title {
    margin: 10px 0;
    font-size: 1.1em;
}

.product-price-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    z-index: 2;
}

.product-price {
    font-weight: bold;
    color: #333;
    margin: 0;
    font-size: 0.95em;
    
    /* Price range styling */
    .amount {
        color: #333;
    }
    
    /* Add dash spacing for ranges */
    .woocommerce-Price-amount + .woocommerce-Price-amount {
        margin-left: 5px;
    }
}

.buy-now-icon {
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #4e4e4e;
    border-radius: 50%;
    color: #fff !important;
    transition: all 0.3s ease;
}

.buy-now-icon:hover {
    background: #333;
    transform: scale(1.1);
}

/* Remove the variable-specific styling since we're using the same icon */

.buy-now-icon .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

.fabilo-product-search {
    margin-bottom: 30px;
}

.fabilo-product-search form {
    display: flex;
    gap: 10px;
}

.fabilo-product-search input[type="text"] {
    flex: 1;
    padding: 8px;
}

.fabilo-pagination {
    text-align: center;
    margin-top: 30px;
    clear: both;
    padding: 20px 0;
}

.fabilo-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.fabilo-pagination .page-numbers.current {
    background: #4e4e4e;
    border-color: #4e4e4e;
    color: #fff;
}

.fabilo-pagination .page-numbers:hover:not(.current) {
    background: #f5f5f5;
    border-color: #bbb;
    color: #333;
}

.fabilo-pagination .prev,
.fabilo-pagination .next {
    font-size: 14px;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .fabilo-pagination .page-numbers {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        margin: 0 2px;
        font-size: 14px;
    }

    .fabilo-pagination .prev,
    .fabilo-pagination .next {
        font-size: 12px;
    }
}

.product-image {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    aspect-ratio: 2.4/3;
    border: 1px solid #d3d3d3;
    border-radius: 6px;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

.product-image-link {
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.product-title-link {
    text-decoration: none;
    color: inherit;
}

.product-title-link:hover .woocommerce-loop-product__title {
    color: #4e4e4e;
}

.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff5252;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.out-of-stock .buy-now-icon {
    opacity: 0.5;
    pointer-events: none;
}

/* .out-of-stock {
    background: #ff5252;
} */

.product-item.out-of-stock {
    opacity: 0.8;
}

/* Modal Styles */
.fabilo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
}

.fabilo-modal-content {
    position: relative;
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
}

.modal-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: #333;
}

.fabilo-close {
    display: none;
}

.fabilo-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px 0;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4e4e4e transparent;
}

.fabilo-categories-grid::-webkit-scrollbar {
    width: 6px;
}

.fabilo-categories-grid::-webkit-scrollbar-track {
    background: transparent;
}

.fabilo-categories-grid::-webkit-scrollbar-thumb {
    background-color: #4e4e4e;
    border-radius: 3px;
}

.category-item {
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.category-item.selected {
    border-color: #4e4e4e;
    background: rgba(78, 78, 78, 0.05);
}

.category-item.selected:hover {
    border-color: #333;
}

.attribute-group {
    margin: 20px 0;
}

.attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attribute-option {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.attribute-option input[type="radio"] {
    margin-right: 8px;
}

.fabilo-preferences-trigger {
    position: fixed;
    left: calc(100% - 20px);
    top: 50%;
    transform: translate(-100%, -50%);
    padding: 10px;
    background: #4e4e4e;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 999;
    .preference-text {
        white-space: nowrap;
    }
}

.trigger-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.selected-preferences {
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
}

.trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
}

.fabilo-preferences-trigger:hover {
    background: #333;
}

.modal-actions {
    text-align: center;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.back-to-categories {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-to-categories:hover {
    background: #eee;
    color: #333;
}

.apply-filters {
    background: #4e4e4e;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-filters:hover {
    background: #333;
    transform: scale(1.05);
}

/* Remove old styles */
.fabilo-preferences-trigger-wrap,
.preference-item,
.preference-label {
    display: none;
}

@media (max-width: 768px) { 
    .fabilo-preferences-trigger {
        left: calc(100% - 20px);
        transform: translate(-20px, 50%) rotate(-90deg);
        transform-origin: left center;
        min-width: 180px;
        transition: right 0.3s ease;
    }

    .fabilo-preferences-trigger:hover {
        right: -75px;
    }

    .selected-preferences {
        font-size: 13px;
    }

    .trigger-icon {
        width: 30px;
        height: 30px;
    }
}

.selected-preferences.show {
    opacity: 1;
    transform: translateX(0);
}

.selected-preferences .preference-item {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.selected-preferences .preference-label {
    font-weight: bold;
    color: #666;
    font-size: 12px;
}

.fabilo-preferences-trigger-wrap:hover .selected-preferences {
    opacity: 1;
    transform: translateX(0);
}

/* Make size text uppercase */
.attribute-option span,
.selected-preferences .preference-text {
    text-transform: uppercase;
}

.quick-buy-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    min-width: 120px;
    margin-top: 5px;
}

.quick-buy-dropdown.active {
    display: block;
}

.quick-buy-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.quick-buy-option:last-child {
    border-bottom: none;
}

.quick-buy-option:hover {
    background: #f5f5f5;
}

.quick-buy-option.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading .dashicons {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add these styles at an appropriate location in your CSS file */

.products-count-title {
    margin: 0 0 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 1.5em;
    color: #333;
}

.products-count-title .size-filter {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

@media (max-width: 768px) {
    .products-count-title {
        font-size: 1.2em;
        margin-bottom: 20px;
    }
}

.fabilo-active-filters {
    margin-bottom: 30px;
}

.products-count-title {
    font-size: 1.2em;
    color: #333;
    margin: 0 0 20px;
}

.products-count-title .category-filter,
.products-count-title .size-filter {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
    margin-left: 5px;
}

.no-products {
    text-align: center;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 4px;
    margin: 20px 0;
}

/* Shortcode Grid Styles */
.fabilo-categories-grid.shortcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 30px 0;
    max-height: none;
    overflow: visible;
}

@media (max-width: 768px) {
    .fabilo-categories-grid.shortcode-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .fabilo-categories-grid.shortcode-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.product-type-variable .product-link {
    cursor: pointer;
}

/* Make the entire product card clickable */
.product-item {
    position: relative;
}

.product-item .product-link {
    position: relative;
    z-index: 1;
}

.product-item .quick-buy-icon {
    position: relative;
    z-index: 2;
}

.product-link.direct-checkout {
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-link.direct-checkout:hover .woocommerce-loop-product__title {
    color: #4e4e4e;
}

.buy-now-icon.direct-checkout {
    cursor: pointer;
}

.flex-viewport {
    border: 1px solid rgb(215, 215, 215);
    border-radius: 8px;
}

/* Update category item styles */
.fabilo-categories-grid.shortcode-grid .category-item {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fabilo-categories-grid.shortcode-grid .category-item img {
    margin-bottom: 0;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.category-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.child-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.child-category {
    font-size: 0.8em;
    color: #666;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.child-category:hover {
    background: #eee;
    color: #333;
}