/**
 * PRODUCT CARD STYLE - VERSION v9
 * Base visuelle : image carre + titre 2 lignes + prix|couleurs + swatches
 */

/* ========================================
   1. GRILLE PRODUITS
   ======================================== */

.woocommerce ul.products,
.elementor-widget-woocommerce-products .woocommerce ul.products,
.elementor-section-stretched .woocommerce ul.products,
.elementor-section-full_width .woocommerce ul.products,
.elementor-widget-container .woocommerce ul.products,
.elementor-widget-wc-products .woocommerce ul.products,
.elementor-element .woocommerce ul.products,
.woocommerce.columns-4 ul.products,
body:not(.elementor-page) .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    margin: 0 !important;
    padding: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: start !important;
    list-style: none !important;
}

.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
    align-self: stretch !important;
    height: auto !important;
    min-height: unset !important;
}

ul.products[class*="columns-"] li.product {
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   2. CARTE
   ======================================== */

.custom-card-wrapper {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: visible;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100% !important;
    box-sizing: border-box !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
}

.custom-card-wrapper:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,0.11);
    transform: translateY(-4px);
    z-index: 10;
}

/* ========================================
   3. ZONE IMAGE
   ======================================== */

.product-image-wrapper {
    position: relative;
    background-color: #F5F5F0;
    aspect-ratio: 1 / 1;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    box-sizing: border-box;
}

.image-link-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.product-image-wrapper img,
.product-image-wrapper img.product-card-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
    mix-blend-mode: multiply;
    transition: transform 0.4s ease;
    z-index: 0;
}

.custom-card-wrapper:hover .product-image-wrapper img {
    transform: scale(1.06);
}

/* Badges */
.badge-bestseller {
    position: absolute;
    top: 12px; left: 12px;
    background: #2c2c54;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-category-badge {
    position: absolute;
    top: 12px; right: 12px;
    background: #D4AF37;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bouton ajout rapide */
.quick-add-button {
    position: absolute;
    bottom: 12px; right: 12px;
    background: #2c2c54;
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 10;
    border: none;
    display: block !important;
}

.custom-card-wrapper:hover .quick-add-button {
    opacity: 1;
    transform: translateY(0);
}

.quick-add-button:hover {
    background: #1a1a3e;
}

/* ========================================
   4. CONTENU CARTE
   ======================================== */

.product-content {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 18px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-sizing: border-box;
    flex: 0 0 144px;
    height: 144px;
    min-height: 144px;
    max-height: 144px;
    overflow: hidden;
    gap: 6px;
}

.product-model-name {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
    margin: 0 0 2px 0;
}

/* Titre : exactement 2 lignes */
.woocommerce-loop-product__title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #000 !important;
    line-height: 1.35 !important;
    height: 43px !important;
    min-height: 43px !important;
    max-height: 43px !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
}

.product-price-wrapper {
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap !important;
    overflow: hidden;
    flex-shrink: 0;
}

.product-price-wrapper .price,
.product-price-wrapper span.price {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    white-space: nowrap !important;
}

.price,
.woocommerce-Price-amount,
.amount {
    font-family: 'Outfit', sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #000 !important;
    white-space: nowrap !important;
    display: inline !important;
}

.price * { color: #000 !important; white-space: nowrap !important; display: inline !important; }
.price ins, .price del { display: inline !important; margin: 0 2px !important; }
.price bdi { display: inline !important; }
.price del + ins::before { content: none !important; }

.product-price-wrapper a,
.product-price-wrapper a * {
    color: #000 !important;
    text-decoration: none !important;
}

/* Separateur | entre prix et couleurs */
.price-color-separator {
    color: #ccc;
    font-size: 18px;
    font-weight: 300;
    margin: 0 8px;
    flex-shrink: 0;
    line-height: 1;
}

/* Compteur couleurs */
.color-count {
    font-family: 'Outfit', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    color: #666 !important;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    display: inline !important;
}

.color-count:empty { display: none !important; }
.price-color-separator:empty,
.price-color-separator + .color-count:empty { display: none !important; }

.product-color-info {
    display: none !important;
}

/* ========================================
   FOOTER
   ======================================== */
.product-footer-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.product-price-line {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex-wrap: nowrap;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    overflow: hidden !important;
    line-height: 28px !important;
}

.product-price-wrapper,
.product-price-wrapper .price,
.product-price-wrapper span.price,
.product-price-wrapper .woocommerce-Price-amount,
.product-price-wrapper .amount,
.product-price-wrapper bdi,
.product-price-wrapper ins,
.product-price-wrapper del {
    display: inline !important;
    white-space: nowrap !important;
    line-height: 28px !important;
    vertical-align: middle !important;
}

.product-color-swatches {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
    height: 28px;
    min-height: 28px;
    padding: 2px 0 2px;
    box-sizing: border-box;
    overflow: visible;
}

@media (min-width: 1025px) {
    .product-content {
        flex: 0 0 154px !important;
        height: 154px !important;
        min-height: 154px !important;
        max-height: 154px !important;
    }
}

.product-color-swatches:empty {
    display: flex !important;
}

.color-swatch {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    max-width: 22px;
    max-height: 22px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-block;
    box-sizing: border-box;
    transition: box-shadow 0.15s ease;
}

.color-swatch.selected-swatch {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2c2c54 !important;
}

.color-swatch:hover {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #999;
}

/* ========================================
   6. NETTOYAGE WOOCOMMERCE NATIF
   ======================================== */

.woocommerce ul.products li.product > .woocommerce-loop-product__link,
.woocommerce ul.products li.product > .price,
.woocommerce ul.products li.product > .woocommerce-loop-product__title,
.woocommerce ul.products li.product > .button.add_to_cart_button,
.woocommerce ul.products li.product > .added_to_cart,
.woocommerce ul.products li.product > .onsale,
.woocommerce-card__header,
.product__categories {
    display: none !important;
}

/* ========================================
   7. IMAGE PROMOTIONNELLE DANS LA GRILLE
   ======================================== */

.promo-grid-image-wrapper {
    grid-column: span 2 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    align-self: start !important;
    aspect-ratio: 2 / 1 !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
}

.promo-grid-image-wrapper .promo-grid-image-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.promo-grid-image-wrapper .promo-grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.promo-grid-image-wrapper:hover .promo-grid-image {
    transform: scale(0.97);
    opacity: 0.92;
}

/* ========================================
   8. MODAL QUICK VIEW
   ======================================== */

.custom-modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100% !important; height: 100% !important;
    background: rgba(0,0,0,0.8) !important;
    z-index: 9999999 !important;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0; transition: opacity 0.15s ease-out;
}

.custom-modal-content {
    background-color: #fff !important;
    width: 90% !important; max-width: 1000px !important; max-height: 90vh !important;
    border-radius: 20px; padding: 40px !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    position: relative; overflow: hidden;
}

.close-modal {
    position: absolute; top: 15px; right: 20px;
    font-size: 28px; color: #999; cursor: pointer;
    z-index: 10; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.1s ease-out;
}
.close-modal:hover { background: #f0f0f0; }

.modal-grid {
    display: grid; grid-template-columns: 1fr 1.2fr;
    gap: 40px; align-items: stretch; min-height: 500px;
}

.modal-image-column { width: 100%; display: flex; flex-direction: column; }

.image-bg-container {
    background-color: #F5F5F0 !important; border-radius: 12px; padding: 30px;
    display: flex; align-items: center; justify-content: center;
    flex: 1; min-height: 500px;
}

.modal-product-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.modal-product-image img {
    max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain; display: block; mix-blend-mode: multiply;
}

.modal-info-column { width: 100%; display: flex; flex-direction: column; justify-content: space-between; }

.modal-product-title { font-size: 24px; margin: 0 0 10px 0; font-weight: 700; color: #000; }

.modal-product-price {
    font-size: 22px !important; font-weight: 800 !important;
    margin: 10px 0 !important; color: #000 !important;
    line-height: 1.2 !important; white-space: nowrap !important;
}
.modal-product-price * { font-size: 22px !important; font-weight: 800 !important; color: #000 !important; white-space: nowrap !important; }
.modal-product-price del { opacity: 0.6; text-decoration: line-through; }
.modal-product-price ins { text-decoration: none; }

.modal-tags-wrapper { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }

.modal-tag {
    display: inline-block; background: #f4f4f4;
    padding: 5px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; color: #000;
}

.badge-top-vente { background: #000 !important; color: #fff !important; }

.stock-status-wrapper {
    display: flex; align-items: center; gap: 8px;
    margin: 12px 0; color: #2eae7a; font-weight: 700; font-size: 14px;
}

.pulse-dot {
    width: 10px; height: 10px; background-color: #2eae7a;
    border-radius: 50%; position: relative; flex-shrink: 0;
}
.pulse-dot::after {
    content: ""; position: absolute; width: 100%; height: 100%;
    background: inherit; border-radius: 50%; animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.current-color-display { color: #666; font-weight: 400; }

.modal-selection-area { margin: 16px 0; }
.selection-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: #000; }

.modal-swatches-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px; margin-top: 8px;
}

.modal-swatch-polaroid {
    background: #fff !important; border: 2px solid #e2e2e2; border-radius: 10px;
    cursor: pointer; overflow: hidden; display: flex; flex-direction: column;
    transition: border-color 0.1s, box-shadow 0.1s;
}
.modal-swatch-polaroid:hover { border-color: #999; }
.modal-swatch-polaroid.active { border: 2px solid #000 !important; box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important; }

.swatch-img-box {
    width: 100%; height: 90px; background-color: #F5F5F0 !important;
    display: flex; align-items: center; justify-content: center;
    padding: 8px; overflow: hidden; border-radius: 8px 8px 0 0;
}
.swatch-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.swatch-text-area {
    padding: 8px 6px; background: #fff !important;
    border-top: 1px solid #f0f0f0; text-align: center;
    min-height: 52px; display: flex; flex-direction: column; justify-content: center;
}
.swatch-v-name { font-size: 12px !important; font-weight: 700 !important; margin: 0 0 3px 0 !important; color: #333 !important; line-height: 1.3 !important; }
.swatch-v-price { font-size: 13px !important; color: #000 !important; font-weight: 700 !important; margin: 0 !important; white-space: nowrap !important; }
.swatch-v-price * { font-weight: 700 !important; display: inline !important; font-size: 13px !important; white-space: nowrap !important; }

.modal-actions {
    display: flex !important; flex-direction: row !important; align-items: stretch !important;
    gap: 12px !important; margin-top: 16px !important; flex-wrap: nowrap !important;
}
.modal-quantity-section { margin: 0 !important; flex-shrink: 0 !important; }
.quantity-controls { display: flex !important; align-items: center !important; height: 46px !important; }

.qty-btn {
    width: 38px !important; height: 46px !important; border: 2px solid #e0e0e0 !important;
    background: #fff !important; color: #333 !important; font-size: 18px !important; font-weight: 700 !important;
    cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important;
    transition: all 0.2s ease !important; padding: 0 !important; margin: 0 !important;
    line-height: 1 !important; flex-shrink: 0 !important;
}
.qty-minus { border-radius: 8px 0 0 8px !important; border-right: 1px solid #e0e0e0 !important; }
.qty-plus { border-radius: 0 8px 8px 0 !important; border-left: 1px solid #e0e0e0 !important; }
.qty-btn:hover { border-color: #999 !important; background: #fafafa !important; }

.qty-input {
    width: 44px !important; height: 46px !important; padding: 0 !important;
    border: 2px solid #e0e0e0 !important; border-left: none !important; border-right: none !important;
    border-radius: 0 !important; text-align: center !important; font-size: 15px !important;
    font-weight: 700 !important; color: #000 !important; background: #fff !important;
    -moz-appearance: textfield !important; margin: 0 !important; flex-shrink: 0 !important;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none !important; }
.qty-input:focus { outline: none !important; }

.btn-add-final {
    flex: 1 1 auto !important; height: 46px !important;
    padding: 0 20px !important; display: flex !important; align-items: center !important; justify-content: center !important;
    background: #000; color: #fff; border: none; font-weight: 700; letter-spacing: 1px;
    cursor: pointer; text-transform: uppercase; font-size: 13px; border-radius: 8px; transition: background 0.1s;
}
.btn-add-final:hover { background: #333; }
.quantity-section-label { display: none !important; }
.view-details-link { display: block; text-align: center; margin-top: 10px; font-weight: 700; text-decoration: underline; color: #000; font-size: 13px; }

.modal-attr-section { margin-bottom: 12px; }
.modal-attr-btns-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.modal-attr-btn {
    display: flex; align-items: center; justify-content: center; min-width: 44px; height: 40px;
    padding: 6px 16px; border: 2px solid #e0e0e0; border-radius: 8px; background: #fff;
    color: #333; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
    user-select: none; font-family: inherit;
}
.modal-attr-btn:hover { border-color: #999; background: #fafafa; }
.modal-attr-btn.selected { border-color: #000 !important; background: #f4f4f4 !important; color: #000 !important; font-weight: 700; }

#added-to-cart-modal { opacity: 0; }
.custom-modal-overlay { transition: opacity 0.15s ease-out !important; }
.modal-product-image img { opacity: 1; }

/* ========================================
   9. RESPONSIVE
   ======================================== */

@media (min-width: 641px) and (max-width: 1024px) {
    .woocommerce ul.products,
    .elementor-widget-woocommerce-products .woocommerce ul.products,
    .elementor-widget-wc-products .woocommerce ul.products,
    .woocommerce.columns-4 ul.products,
    body:not(.elementor-page) .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .woocommerce ul.products li.product,
    .elementor-widget-woocommerce-products .woocommerce ul.products li.product,
    .elementor-widget-wc-products .woocommerce ul.products li.product,
    .woocommerce.columns-4 ul.products li.product {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }

    .custom-card-wrapper,
    .elementor-widget-woocommerce-products .custom-card-wrapper,
    .elementor-widget-wc-products .custom-card-wrapper {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }

    .product-image-wrapper {
        aspect-ratio: 1 / 1 !important;
        flex-shrink: 0 !important;
    }

    .product-content {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 140px !important;
        max-height: unset !important;
        padding: 12px 14px 16px !important;
    }

    .woocommerce-loop-product__title {
        font-size: 15px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
    }

    .price,
    .woocommerce-Price-amount,
    .amount { font-size: 17px !important; }

    .color-count { font-size: 17px !important; }
    .price-color-separator { font-size: 17px !important; }

    .promo-grid-image-wrapper {
        grid-column: span 2 !important;
        aspect-ratio: 2 / 1 !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }
}

@media (max-width: 640px) {
    .woocommerce ul.products,
    .elementor-widget-woocommerce-products .woocommerce ul.products,
    .elementor-widget-wc-products .woocommerce ul.products,
    .woocommerce.columns-4 ul.products,
    body:not(.elementor-page) .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 4px !important;
    }

    .woocommerce ul.products li.product {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }

    .custom-card-wrapper {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }

    .product-image-wrapper {
        aspect-ratio: 1 / 1 !important;
        padding: 10px !important;
        flex-shrink: 0 !important;
    }

    .product-content {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 128px !important;
        max-height: unset !important;
        padding: 10px 10px 16px !important;
    }

    .woocommerce-loop-product__title {
        font-size: 14px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        margin: 0 0 4px 0 !important;
    }

    .price,
    .woocommerce-Price-amount,
    .amount { font-size: 16px !important; }

    .color-count { font-size: 16px !important; }
    .price-color-separator { font-size: 16px !important; }

    @media (max-width: 399px) {
        .price,
        .woocommerce-Price-amount,
        .amount,
        html body .price,
        html body .woocommerce-Price-amount,
        html body .amount { font-size: 13px !important; }

        .color-count,
        html body .color-count,
        #grille-meme-categorie .color-count,
        .ps-section .color-count,
        .woocommerce ul.products li.product .color-count { font-size: 13px !important; }

        .price-color-separator,
        html body .price-color-separator { font-size: 13px !important; }

        .product-price-line {
            height: 20px !important;
            min-height: 20px !important;
            max-height: 20px !important;
            line-height: 20px !important;
        }

        .product-color-swatches {
            gap: 4px !important;
        }
    }

    .product-price-line {
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        line-height: 22px !important;
    }

    .product-color-swatches {
        height: 28px !important;
        min-height: 28px !important;
        padding: 3px 0 5px !important;
    }

    .color-swatch {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
    }

    .quick-add-button {
        font-size: 9px !important;
        padding: 6px 10px !important;
        bottom: 8px !important;
        right: 8px !important;
    }

    .badge-bestseller,
    .product-category-badge {
        font-size: 9px !important;
        padding: 4px 8px !important;
    }

    .promo-grid-image-wrapper {
        grid-column: span 2 !important;
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
        aspect-ratio: unset !important;
    }

    .woocommerce ul.products li.product {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }

    .custom-card-wrapper {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }

    .product-image-wrapper {
        aspect-ratio: 1 / 1 !important;
        flex-shrink: 0 !important;
    }

    .product-content,
    .woocommerce ul.products li.product .product-content {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 128px !important;
        max-height: unset !important;
        padding: 10px 10px 16px !important;
        gap: 6px !important;
    }

    .product-footer-group {
        gap: 8px !important;
        margin-top: 2px !important;
    }

    .product-color-swatches {
        height: 28px !important;
        min-height: 28px !important;
        padding: 3px 0 5px !important;
    }
}

@media (max-width: 430px) {
    .woocommerce ul.products,
    .elementor-widget-woocommerce-products .woocommerce ul.products,
    .elementor-widget-wc-products .woocommerce ul.products,
    .woocommerce.columns-4 ul.products,
    body:not(.elementor-page) .woocommerce ul.products,
    .home .woocommerce ul.products,
    .elementor-element-b0b8ff2 .woocommerce ul.products,
    .elementor-element-6dfc79a .woocommerce ul.products,
    .elementor-element-78c9521 .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .woocommerce ul.products li.product,
    .home .woocommerce ul.products li.product,
    .elementor-element-b0b8ff2 .woocommerce ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 768px) {
    .custom-modal-content { padding: 20px !important; width: 95% !important; max-height: 95vh !important; overflow-y: auto; border-radius: 16px; }
    .modal-grid { grid-template-columns: 1fr; gap: 20px; min-height: auto; }
    .image-bg-container { min-height: 250px; padding: 20px; }
    .modal-swatches-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
    .swatch-img-box { height: 70px; }
}

@media (min-width: 400px) and (max-width: 640px) {
    .price,
    .woocommerce-Price-amount,
    .amount,
    html body .price,
    html body .woocommerce-Price-amount,
    html body .amount {
        font-size: 16px !important;
    }
    .color-count,
    html body .color-count {
        font-size: 16px !important;
    }
    .price-color-separator,
    html body .price-color-separator {
        font-size: 16px !important;
    }
}

@media (max-width: 768px) {
    .badge-bestseller {
        font-size: 7px !important;
        padding: 3px 6px !important;
        left: 5px !important;
    }
    .product-category-badge {
        font-size: 7px !important;
        padding: 3px 6px !important;
        right: 5px !important;
    }
}