.jwell-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0;
}

/* Dynamic columns based on shortcode parameter */
.jwell-products-grid.jwell-columns-1 {
    grid-template-columns: 1fr;
}

.jwell-products-grid.jwell-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.jwell-products-grid.jwell-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.jwell-products-grid.jwell-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.jwell-products-grid.jwell-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.jwell-products-grid.jwell-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.jwell-product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background: #fff;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.jwell-product-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.jwell-product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.jwell-product-image {
    width: 100%;
    margin-bottom: 10px;
    height: 250px;
    overflow: hidden;
}

.jwell-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.jwell-product-category {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.jwell-product-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.3;
}

.jwell-product-title a {
    text-decoration: none;
    color: #333;
}

.jwell-product-rating {
    margin-bottom: 8px;
}

.jwell-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #E0A000;
    margin-bottom: 10px;
}

.jwell-product-tags {
    margin-bottom: 10px;
}

.jwell-product-tag {
    display: inline-block;
    background: #636363;
    padding: 0px 6px !important;
    border-radius: 10px;
    font-size: 11px;
    color: #fff !important;
    margin: 2px;
    text-decoration: none;
}

.jwell-spacer {
    margin-top: auto;
}

.jwell-product-variations {
    margin-bottom: 15px;
}

.jwell-product-variations select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 5px;
}

.jwell-variation-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.jwell-variation-option {
    padding: 2px 5px !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jwell-variation-option:hover {
    background: #E0A000;
    color: white;
    border-color: #E0A000;
}

.jwell-variation-option.selected {
    background: #E0A000;
    color: white;
    border-color: #E0A000;
}

/* Cart Form Styles */
.jwell-cart-form {
    margin-top: 15px;
}

button.jwell-add-to-cart {
    margin: 0px;
    padding: 14px 0px;
}

.jwell-add-to-cart {
    width: 100% !important;
    background: #E0A000 !important;
    color: white !important;
    border: none !important;
    padding: 8px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: bold !important;
    transition: background-color 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
}

.jwell-add-to-cart:hover:not(:disabled) {
    background: #c7900a !important;
    color: white !important;
}

.jwell-add-to-cart:disabled,
.jwell-add-to-cart.disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    color: #666 !important;
}

/* Hide WooCommerce default form elements that we don't need */
.jwell-cart-form input[type="hidden"] {
    display: none;
}

/* Quantity Selector Styles */
.jwell-quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 10px;
}

.jwell-quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    user-select: none;
}

.jwell-quantity-btn:hover:not(:disabled) {
    background: #E0A000;
    color: white;
    border-color: #E0A000;
}

.jwell-quantity-btn:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.jwell-quantity-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
}

.jwell-stock-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

.jwell-stock-info.stock-rupture {
    color: #c62828;
    font-weight: 600;
}

.jwell-stock-info.stock-commande {
    color: #f57c00;
    font-weight: 600;
}

.jwell-stock-info.stock-available {
    color: #2e7d32;
}

.jwell-stock-info.stock-low {
    color: #ed6c02;
    font-weight: 600;
}

.jwell-stock-warning {
    font-size: 12px;
    color: #ff6b6b;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
}

.jwell-backorder-notice {
    font-size: 11px;
    color: #ff8c00;
    margin-bottom: 10px;
    text-align: center;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Default fallback for tablets */
    .jwell-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Responsive behavior for different column counts on tablets */
    .jwell-products-grid.jwell-columns-1 {
        grid-template-columns: 1fr;
    }
    
    .jwell-products-grid.jwell-columns-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jwell-products-grid.jwell-columns-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .jwell-products-grid.jwell-columns-4,
    .jwell-products-grid.jwell-columns-5,
    .jwell-products-grid.jwell-columns-6 {
        grid-template-columns: repeat(3, 1fr); /* Max 3 columns on tablet */
    }
    
    .jwell-product-image {
        height: 200px;
    }
    
    /* Sur tablette, afficher les sélecteurs */
    .jwell-variation-options {
        display: none;
    }
    
    .jwell-product-variations select {
        display: block;
    }
}

@media (max-width: 768px) {
    /* Default fallback for mobile */
    .jwell-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Responsive behavior for different column counts on mobile */
    .jwell-products-grid.jwell-columns-1 {
        grid-template-columns: 1fr;
    }
    
    .jwell-products-grid.jwell-columns-2,
    .jwell-products-grid.jwell-columns-3,
    .jwell-products-grid.jwell-columns-4,
    .jwell-products-grid.jwell-columns-5,
    .jwell-products-grid.jwell-columns-6 {
        grid-template-columns: repeat(2, 1fr); /* Max 2 columns on mobile */
    }
    
    .jwell-product-item {
        padding: 12px;
    }
    
    .jwell-product-image {
        height: 160px;
    }
    
    /* Sur mobile, afficher les sélecteurs */
    .jwell-variation-options {
        display: none;
    }
    
    .jwell-product-variations select {
        display: block;
    }
}

/* Sur desktop, cacher les sélecteurs et afficher les grilles */
@media (min-width: 1025px) {
    .jwell-product-variations select {
        display: none;
    }
    
    .jwell-variation-options {
        display: grid;
    }
}

/* ===== PAGINATION STYLES ===== */

.jwell-pagination-wrapper {
    margin: 40px 0;
    text-align: center;
}

.jwell-pagination {
    display: inline-flex;
    list-style: none !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

.jwell-pagination .page-item {
    margin: 0;
    padding: 0;
}

.jwell-pagination .page-item a,
.jwell-pagination .page-item span {
    display: inline-block;
    min-width: 44px;
    height: 44px;
    line-height: 42px;
    padding: 0 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    background: #fff;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.jwell-pagination .page-item a:hover {
    background: #f8f9fa;
    border-color: #e0a000;
    color: #e0a000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.jwell-pagination .page-item .current {
    background: #e0a000;
    border-color: #e0a000;
    color: #fff;
    cursor: default;
}

.jwell-pagination .page-item .current:hover {
    background: #e0a000;
    border-color: #e0a000;
    color: #fff;
    transform: none;
    box-shadow: none;
}

.jwell-pagination .page-item .dots {
    border: none;
    background: transparent;
    color: #666;
    cursor: default;
}

.jwell-pagination .page-item .dots:hover {
    background: transparent;
    border: none;
    color: #666;
    transform: none;
    box-shadow: none;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .jwell-pagination {
        gap: 4px;
    }
    
    .jwell-pagination .page-item a,
    .jwell-pagination .page-item span {
        min-width: 36px;
        height: 36px;
        line-height: 34px;
        padding: 0 8px;
        font-size: 14px;
    }
    
    .jwell-pagination .page-item .current,
    .jwell-pagination .page-item .dots {
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .jwell-pagination-wrapper {
        margin: 20px 0;
    }
    
    .jwell-pagination .page-item a,
    .jwell-pagination .page-item span {
        min-width: 32px;
        height: 32px;
        line-height: 30px;
        padding: 0 6px;
        font-size: 12px;
    }
}

 /* Active Filters Tags */
.jwell-active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* When there's only the counter (no title), center it */
.jwell-active-filters-header:only-child {
    justify-content: flex-end;
    margin-bottom: 0;
}

.jwell-active-filters h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.jwell-results-count {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.jwell-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jwell-filter-tag {
    display: inline-flex;
    align-items: center;
    color: #636363 !important;
    border : 1px solid #636363 !important;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.jwell-filter-tag-remove {
    margin-left: 8px;
    background: #e0a00080;
    border-radius: 50%;
    width: 21px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    transition: background 0.2s ease;
}

.jwell-filter-tag-remove:hover {
    background: #dc354563;
}

.jwell-clear-all-filters {
    background: #e0a000;
    color: #fff !important;
    margin-left: 14px;
}

.jwell-clear-all-filters:hover {
    background: #e0a000;
}

@media (max-width: 768px) {
    .jwell-active-filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .jwell-results-count {
        font-size: 11px;
    }
    
    .jwell-filter-tags {
        gap: 6px;
    }
    
    .jwell-filter-tag {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .jwell-filter-tag-remove {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }
    
    .jwell-clear-all-filters {
        margin-left: 0;
        margin-top: 4px;
    }
}

/* Mobile Bottom Sheet Styles */
.jwell-mobile-filter-btn {
    display: none;
    align-items: center;
    margin: auto;
    gap: 8px;
    padding: 12px 20px;
    background: #e0a000;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.jwell-mobile-filter-btn:hover {
    background: #e0a000;
    transform: translateY(-1px);
}

.jwell-desktop-filters {
    display: block;
}

.jwell-mobile-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    display: none;
}

.jwell-mobile-bottom-sheet.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

.jwell-bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.jwell-bottom-sheet-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.jwell-mobile-bottom-sheet.active .jwell-bottom-sheet-container {
    transform: translateY(0);
}

.jwell-bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
    border-radius: 20px 20px 0 0;
}

.jwell-bottom-sheet-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.jwell-bottom-sheet-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.jwell-bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

.jwell-mobile-filter-sections {
    padding: 20px 0;
}

.jwell-mobile-filter-section {
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.jwell-mobile-filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
}

.jwell-mobile-filter-section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.jwell-section-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.jwell-mobile-filter-section.expanded .jwell-section-toggle {
    transform: rotate(180deg);
}

.jwell-mobile-filter-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.jwell-mobile-filter-section.expanded .jwell-mobile-filter-section-content {
    max-height: 300px;
}

.jwell-mobile-filter-options {
    padding-bottom: 15px;
}

.jwell-mobile-filter-option {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 0;
}

.jwell-mobile-filter-option:hover {
    background-color: #f8f9fa;
}

.jwell-mobile-filter-option input[type="checkbox"] {
    display: none;
}

.jwell-mobile-filter-option .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    background: white;
    transition: all 0.2s ease;
}

.jwell-mobile-filter-option.selected .checkmark,
.jwell-mobile-filter-option input[type="checkbox"]:checked + .checkmark {
    background: #e0a000;
    border-color: #e0a000;
}

.jwell-mobile-filter-option.selected .checkmark:after,
.jwell-mobile-filter-option input[type="checkbox"]:checked + .checkmark:after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.jwell-mobile-filter-option .option-label {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.jwell-bottom-sheet-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: white;
    display: flex;
    gap: 12px;
}

.jwell-mobile-filter-reset {
    flex: 1;
    padding: 12px 20px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jwell-mobile-filter-reset:hover {
    background: #e9ecef;
    color: #333;
}

.jwell-mobile-filter-apply {
    flex: 2;
    padding: 12px 20px;
    background: #e0a000;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jwell-mobile-filter-apply:hover {
    background: #e0a000;
}

/* Prevent body scroll when bottom sheet is open */
body.jwell-bottom-sheet-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .jwell-mobile-filter-btn {
        display: flex;
    }
    
    .jwell-desktop-filters {
        display: none;
    }
}