/* Dflex Woo Theme - Product Card Styles */
/* Uses global design system variables --dflex-* */

/* Grid Layout */
.dflex-product-card,
.dflex-product-card *,
.dflex-product-card *::before,
.dflex-product-card *::after {
    box-sizing: border-box;
}

body.dflex-popup-open {
    overflow: hidden;
}

.dflex-product-grid-empty,
.dflex-product-grid-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.dflex-product-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--dflex-grid-cols, 4), 1fr);
    margin-bottom: 30px;
}

.dflex-product-grid.owl-loaded {
    display: block;
}

.dflex-product-grid .owl-dots {
    margin-top: 20px;
    text-align: center;
}

.dflex-product-grid .owl-dot span {
    width: 8px;
    height: 8px;
    background: #ddd;
    display: inline-block;
    border-radius: 50%;
    margin: 0 4px;
    transition: all 0.3s;
}

.dflex-product-grid .owl-dot.active span {
    background: var(--dflex-color-primary, #E53935);
    width: 24px;
    border-radius: 10px;
}

.dflex-product-card {
    background: var(--dflex-card-bg, #ffffff);
    border-radius: 20px;
    box-shadow: var(--dflex-card-shadow, 0px 12px 24px 0px #00000014);
    border: var(--dflex-card-border, 1px solid #f0f0f0);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 100%;
}

/* Category Cards Overrides */
.dflex-category-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.dflex-category-image {
    aspect-ratio: 1/1;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: #fff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dflex-category-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.dflex-category-content {
    padding: 16px 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.dflex-category-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--dflex-color-primary, #1a1a1a);
    text-decoration: none;
}

.dflex-category-count {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
    font-weight: 500;
}

/* Horizontal List Layout (Shortcode layout="list") */
.dflex-product-grid.dflex-grid-pc-list .dflex-product-card {
    flex-direction: row !important;
    align-items: center;
    min-height: 140px;
    height: auto;
}

.dflex-product-grid.dflex-grid-pc-list .dflex-card-image {
    width: 35%;
    max-height: 100%;
    aspect-ratio: auto;
    border-radius: 20px 0 0 20px;
    overflow: hidden;
}

.dflex-product-grid.dflex-grid-pc-list .dflex-card-content {
    width: 65%;
    padding: 15px 20px;
}

.dflex-product-grid.dflex-grid-pc-list .dflex-card-title {
    font-size: var(--dflex-card-title-size, 16px) !important;
    margin-bottom: 8px;
}

.dflex-product-grid.dflex-grid-pc-list .dflex-card-footer {
    border-top: 0;
    padding-top: 10px;
    margin-top: auto;
}

.dflex-product-card:hover {
    box-shadow: var(--dflex-card-shadow-hover, 0 12px 24px rgba(0, 0, 0, 0.1));
    transform: translateY(-5px);
}

.dflex-card-image {
    max-height: 190px;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: white;
    border-radius: 16px 16px 0 0;
}

.dflex-card-img-link {
    padding-top: 10px;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
}

div.dflex-card-img-link {
    cursor: default;
}

/* Badges Stack */
.dflex-product-badges {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: var(--dflex-badge-gap, 5px);
    z-index: 20;
    pointer-events: none;
    max-width: 80%;
}

.dflex-product-badges .dflex-badge {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    border-radius: var(--dflex-badge-radius, 4px) !important;
    padding: var(--dflex-badge-padding, 4px 8px) !important;
    font-size: var(--dflex-badge-font-size, 11px) !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-transform: uppercase;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dflex-pos-top-left {
    top: 12px;
    left: 12px;
    align-items: flex-start;
}

.dflex-pos-top-right {
    top: 12px;
    right: 12px;
    align-items: flex-end;
}

.dflex-pos-bottom-left {
    bottom: 12px;
    left: 12px;
    align-items: flex-start;
}

.dflex-pos-bottom-right {
    bottom: 12px;
    right: 12px;
    align-items: flex-end;
}

.dflex-badge-sale {
    background: var(--dflex-badge-sale-bg, #FF3B30);
    color: var(--dflex-badge-sale-text, #FFF);
}

.dflex-badge-new {
    background: var(--dflex-badge-new-bg, var(--dflex-color-success, #34C759));
    color: var(--dflex-badge-new-text, #FFF);
}

.dflex-badge-hit {
    background: var(--dflex-badge-hit-bg, #FF9500);
    color: var(--dflex-badge-hit-text, #FFF);
}

.dflex-badge-out-of-stock {
    background: var(--dflex-badge-oos-bg, #8E8E93);
    color: var(--dflex-badge-oos-text, #FFF);
}

.dflex-badge-custom {
    background: #AF52DE;
    color: #FFF;
}

/* Normal flow image without absolute positioning */
.dflex-card-image img {
    width: 100%;
    max-width: 320px !important;
    height: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    border: none;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.dflex-card-img-hover {
    opacity: 0;
    z-index: 1;
}

.dflex-product-card:hover .dflex-card-img-main {
    opacity: 0;
}

.dflex-product-card:hover .dflex-card-img-hover {
    opacity: 1;
}

/* Fallback if no secondary image, zoom main image */
.dflex-product-card:hover .dflex-card-img-main:only-child {
    opacity: 1;
    transform: scale(1.05);
}

.dflex-card-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 0;
    background-color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dflex-color-primary);
    font-size: 16px;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease-in-out;
}

.dflex-card-wishlist i {
    color: var(--dflex-color-primary);
}

.dflex-card-wishlist:hover {
    color: var(--dflex-color-primary) !important;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.dflex-card-wishlist:hover i,
.dflex-card-wishlist.active,
.dflex-card-wishlist.active i {
    color: var(--dflex-color-primary) !important;
}

.dflex-card-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dflex-card-title {
    font-weight: var(--dflex-card-title-weight, 700);
    margin: 0 0 5px;
    font-size: var(--dflex-card-title-size, 20px);
    line-height: 1.4;
    color: var(--dflex-card-title-color, var(--dflex-color-primary, #E53935));
}

.dflex-card-title a {
    text-decoration: none;
    transition: color 0.2s ease;
    color: var(--dflex-card-title-color, var(--dflex-color-primary, #E53935));
}

.dflex-card-title a:hover {
    color: var(--dflex-card-title-color, var(--dflex-color-primary, #E53935));
}

.dflex-card-desc {
    font-size: var(--dflex-card-desc-size, 12px);
    font-weight: var(--dflex-card-desc-weight, 300);
    color: var(--dflex-card-desc-color, #757575);
    margin-bottom: 0;
    line-height: 1.5;

    /* line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dflex-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 12px;
    padding-top: 20px;
}

.dflex-card-price {
    font-size: 18px;
    font-weight: 500;
    color: var(--dflex-color-primary, #1a1a1a);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    align-items: flex-start;
    justify-content: flex-start;
}

.dflex-card-price ins {
    text-decoration: none;
    font-weight: var(--dflex-card-price-weight, 500);
    color: var(--dflex-card-price-color, var(--dflex-color-primary));
    background: transparent;
}

.dflex-card-price del {
    color: var(--dflex-color-text-muted, #999);
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
    opacity: 0.8;
}

.dflex-card-price .dflex-price-from {
    font-size: 12px;
    font-weight: 400;
    color: var(--dflex-color-text-muted, #888);
}

.dflex-price-out-of-stock {
    color: var(--dflex-color-text-muted, #999);
    text-decoration: line-through;
}

/* Buttons */
.dflex-btn-add_to_cart,
.dflex-btn-detail,
.dflex-btn-primary {
    box-shadow: none;
    flex-shrink: 0;
}

.dflex-btn-add_to_cart i {
    font-size: 14px;
}

/* Hover handled globally */

.dflex-btn-add_to_cart:active {
    transform: translateY(0);
}

.dflex-btn-add_to_cart.is-added {
    background: var(--dflex-color-success, #34C759) !important;
    color: white !important;
    border-color: var(--dflex-color-success, #34C759) !important;
}

.dflex-btn-add_to_cart.is-added:hover {
    background: var(--dflex-color-success-hover, #30B753);
}

.dflex-clickable-img {
    cursor: pointer;
}

/* Qty Controls */
.dflex-card-qty-controls {
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: var(--dflex-btn-radius, 12px);
    padding: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dflex-hidden-initial {
    display: none;
}

.dflex-var-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

/* Hover handled globally */
.dflex-qty-val {
    width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

/* Hide default WooCommerce "View Cart" link after AJAX add */
.dflex-product-card .added_to_cart,
.dflex-var-popup-modal .added_to_cart,
.dflex-product-card .added_to_cart.wc-forward,
.dflex-var-popup-modal .added_to_cart.wc-forward {
    display: none !important;
}

/* PC/Tablet Horizontal List View */
@media (min-width: 768px) {
    .dflex-grid-pc-list .dflex-product-card {
        flex-direction: row;
        align-items: center;
        padding: 24px;
        gap: 24px;
        text-align: left;
    }

    .dflex-grid-pc-list .dflex-card-image {
        width: 35%;
        max-width: 160px;
        aspect-ratio: 1 / 1;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .dflex-grid-pc-list .dflex-card-content {
        padding: 0;
        width: 65%;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .dflex-grid-pc-list .dflex-card-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 16px;
        padding-top: 0;
    }

    .dflex-grid-pc-list .dflex-card-price-group {
        align-items: flex-start;
        margin-bottom: 0;
    }

    .dflex-grid-pc-list .dflex-card-wishlist {
        left: 0;
        right: auto;
        top: 0;
    }
}

/* Mobile Horizontal List View */
@media (max-width: 1024px) {
    .dflex-product-grid {
        grid-template-columns: repeat(var(--dflex-grid-cols-tablet, 3), 1fr);
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .dflex-product-grid {
        grid-template-columns: repeat(var(--dflex-grid-cols-mobile, 1), 1fr);
        gap: 12px;
    }

    /* Disable hover effects and animations on mobile cards and images */
    .dflex-product-card:hover {
        transform: none !important;
        box-shadow: 0px 12px 24px 0px rgba(0, 0, 0, 0.08) !important;
    }

    .dflex-product-card:hover .dflex-card-img-main {
        opacity: 1 !important;
    }

    .dflex-product-card:hover .dflex-card-img-hover {
        opacity: 0 !important;
        display: none !important;
    }

    .dflex-product-card:hover .dflex-card-img-main:only-child {
        transform: none !important;
    }


    /* Mobile List Layout Styles (1 column) */
    .dflex-grid-mob-list .dflex-product-card {
        flex-direction: row;
        align-items: center;
        padding: 10px;
        gap: 16px;
    }

    .dflex-grid-mob-list .dflex-card-image {
        width: 35%;
        aspect-ratio: 1 / 1;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .dflex-grid-mob-list .dflex-card-content {
        padding: 0;
        width: 65%;
    }

    .dflex-grid-mob-list .dflex-card-desc {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 8px;
        font-size: 11px;
    }

    .dflex-grid-mob-list .dflex-card-title {
        font-size: 18px;
        font-weight: 600;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 6px;
        word-break: break-word;
    }

    .dflex-grid-mob-list .dflex-card-wishlist {
        left: 8px;
        right: auto;
        top: 8px;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

.dflex-var-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dflex-var-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dflex-var-popup-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    background: #fff;
    width: 90%;
    max-width: var(--dflex-card-popup-width, 640px);
    max-height: 90vh;
    z-index: 99999;
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.dflex-var-popup-modal *,
.dflex-var-popup-modal *::before,
.dflex-var-popup-modal *::after {
    box-sizing: border-box;
}

.dflex-var-popup-modal.active {
    transform: translate(-50%, -50%);
    opacity: 1;
    visibility: visible;
}

.dflex-var-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 14px;
    cursor: pointer;
    background: #f1f1f1;
    width: 32px;
    height: 32px;
    display: flex;
    color: #1a1a1a;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.2s;
}

.dflex-var-popup-close:hover {
    background: #e1e1e1;
}

.dflex-var-popup-layout {
    display: flex;
    flex-wrap: nowrap;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.dflex-var-popup-wishlist {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #eee;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dflex-var-popup-wishlist:hover {
    transform: scale(1.1);
    color: var(--dflex-color-primary, #E53935);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dflex-var-popup-wishlist.is-active {
    color: var(--dflex-color-primary, #E53935);
}

.dflex-var-popup-image .dflex-var-popup-wishlist {
    top: 20px;
    left: 20px;
}

.dflex-var-popup-image .dflex-var-popup-wishlist.has-badges {
    left: auto;
    right: 20px;
}

.dflex-var-popup-image .dflex-pos-top-left {
    top: 20px;
    left: 20px;
}

.dflex-var-popup-image .dflex-pos-top-right {
    top: 20px;
    right: 20px;
}

@media (max-width: 767px) {
    .dflex-var-popup-image .dflex-var-popup-wishlist {
        top: 40px;
        left: 10px;
    }

    .dflex-var-popup-image .dflex-var-popup-wishlist.has-badges {
        left: auto;
        right: 50px;
    }

    .dflex-var-popup-image .dflex-pos-top-left {
        top: 40px;
        left: 10px;
    }
}

.dflex-var-popup-image {
    position: relative;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dflex-var-popup-image img {
    max-width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: multiply;
}

.dflex-var-popup-details {
    width: 50%;
    padding: 30px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dflex-var-popup-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 10px;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #eee transparent;
}

.dflex-var-popup-scroll-content::-webkit-scrollbar {
    width: 4px;
}

.dflex-var-popup-scroll-content::-webkit-scrollbar-track {
    background: transparent;
}

.dflex-var-popup-scroll-content::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}

.dflex-var-popup-title {
    margin: 0 0 5px;
    font-weight: var(--dflex-card-title-weight, 700);
    font-size: var(--dflex-card-popup-title-size, 24px);
    color: var(--dflex-card-title-color, var(--dflex-color-primary, #E53935));
    max-width: 90%;
}

#dflex-var-popup-qty::-webkit-outer-spin-button,
#dflex-var-popup-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.dflex-var-popup-desc {
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: var(--dflex-card-desc-size, 12px);
    font-weight: var(--dflex-card-desc-weight, 300);
    color: var(--dflex-card-desc-color, #757575);
}

.dflex-var-popup-content .mcl-addon-group {
    overflow-y: visible;
}

.dflex-var-popup-content .mcl-addon-options {
    padding-bottom: 2px;
}

.dflex-var-attr-row {
    margin-bottom: 15px;
}

/* Hide variation row if only 1 option available */
.dflex-var-attr-row:has(.dflex-var-attr-pill:only-child),
.variations tr:has(.variable-item:only-child),
.variations tr:has(.swatch:only-child) {
    display: none !important;
}


.dflex-var-attr-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #888;
}

.dflex-var-attr-options {
    display: flex;
    flex-wrap: wrap;
    background: #F0F0F5;
    border-radius: 16px;
    padding: 6px;
    gap: 6px;
    text-align: center;
    max-width: 100%;
}

.dflex-var-attr-options .dflex-var-attr-pill span {
    font-size: 13px;
    padding: 0;
}

.dflex-var-attr-options .dflex-var-attr-pill span::after,
.dflex-var-attr-options .dflex-var-attr-pill span::before {
    display: none;
}

.dflex-var-attr-radio {
    display: none;
}

.dflex-var-attr-pill {
    flex: 1 1 auto;
    min-width: 44px;
    max-width: 100%;
    border: none;
    border-radius: 12px;
    padding: 7px 12px;
    background: transparent;
    text-align: center;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}

.dflex-var-attr-pill.active {
    background: var(--dflex-color-primary, #E53935);
    border-color: var(--dflex-color-primary, #E53935);
    box-shadow: 0px 0px 10.7px 0px #00000040;
    color: rgb(255, 255, 255);
    border: none;
}

.dflex-btn-var-add-cart {
    background: var(--dflex-btn-bg, var(--dflex-color-primary));
    color: var(--dflex-btn-text, #fff);
    border: var(--dflex-btn-border, none);
    border-radius: var(--dflex-btn-radius, 20px);
    flex: 2;
    padding: var(--dflex-btn-padding, 0 15px);
    font-size: var(--dflex-btn-font-size, 14px);
    font-weight: var(--dflex-btn-font-weight, 500);
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dflex-btn-var-add-cart:hover {
    background: var(--dflex-btn-hover-bg, var(--dflex-color-primary-hover)) !important;
    color: var(--dflex-btn-hover-text, #fff) !important;
    border: var(--dflex-btn-border-hover, none) !important;
}

.dflex-btn-var-add-cart.disabled {
    background: #ccc;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
}

.dflex-var-popup-loading {
    text-align: center;
    padding: 40px;
}

.dflex-var-popup-details {
    color: #000;
}

.dflex-var-popup-toppings {
    margin-top: 20px;
}

.dflex-var-toppings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dflex-topping-item {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    width: 100px;
    text-align: center;
    cursor: pointer;
}

.dflex-topping-checkbox {
    display: none;
}

.dflex-topping-img {
    margin-bottom: 8px;
}

.dflex-topping-img img {
    max-width: 40px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.dflex-topping-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin-bottom: 4px;
}

.dflex-topping-price {
    font-size: 13px;
    font-weight: 600;
    color: #E53935;
}

.dflex-var-popup-footer {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    margin-top: auto;
    padding-top: 25px;
}

.dflex-var-popup-price-display {
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin-bottom: 5px;
}

.dflex-var-popup-qty-wrap {
    display: flex;
    align-items: center;
    background: #f3f3f7;
    border-radius: 10px;
    height: 40px;
    flex: 1;
    min-width: 100px;
    overflow: auto;
    justify-content: space-between;
}

.dflex-var-qty-btn {
    background: transparent;
    border: none;
    width: 34px;
    height: 100%;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dflex-var-qty-btn:hover {
    background: #e9e9ed;
}

#dflex-var-popup-qty {
    width: 32px;
    text-align: center;
    border: none;
    height: 100%;
    font-size: 15px;
    font-weight: 600;
    padding: 0;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    background: transparent;
}

/* Load More Button */
.dflex-btn-load-more {
    background: var(--dflex-load-more-bg, #212121);
    color: var(--dflex-load-more-color, #FFFFFF);
    border-radius: 43px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dflex-btn-load-more::after {
    content: '↓';
    display: inline-block;
    margin-left: 8px;
    font-size: 16px;
}

.dflex-btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

/* Pagination Styling */
.dflex-pagination-wrap {
    margin-top: 30px;
    text-align: center;
}

.dflex-btn-load-more-spacing {
    margin-bottom: 15px;
}

.dflex-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dflex-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--dflex-pagination-size, 40px);
    height: var(--dflex-pagination-size, 40px);
    border: 1px solid var(--dflex-pagination-color, #212121);
    border-radius: var(--dflex-pagination-radius, 8px);
    color: var(--dflex-pagination-color, #212121);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.dflex-pagination .page-numbers.current {
    background: var(--dflex-pagination-active-bg, #E53935);
    color: #fff;
    border-color: var(--dflex-pagination-active-bg, #E53935);
}

.dflex-pagination .page-numbers:hover:not(.current) {
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 767px) {

    /* Variation Popup */
    .dflex-var-popup-content {
        overflow-y: scroll;
        padding-bottom: 80px;
    }

    .dflex-btn-add_to_cart,
    .dflex-btn-detail,
    .dflex-btn-primary {
        padding: 10px 28px;
    }

    .dflex-card-price {
        font-size: 14px;
        flex-direction: row;
        gap: 5px;
    }

    .dflex-card-footer {
        padding-top: 10px;
        flex-direction: column;
    }

    .dflex-card-content {
        padding: 10px;
    }

    .dflex-card-desc {
        font-size: 10px;
    }

    .dflex-card-btn-wrap,
    .dflex-btn-add_to_cart {
        width: 100%;
    }

    .dflex-var-popup-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
        display: flex;
        flex-direction: column;
    }

    .dflex-var-popup-modal.active {
        transform: none;
    }

    .dflex-var-popup-close {
        top: 15px;
        right: 15px;
    }

    .dflex-var-popup-layout {
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 120px;
        /* Added padding to scroller directly */
    }

    .dflex-var-popup-image {
        width: 100%;
        padding: 40px 10px 10px 10px;
        flex-shrink: 0;
    }

    .dflex-var-popup-image img {
        max-height: 250px;
        margin: 0 auto;
    }

    .dflex-var-popup-details {
        width: 100%;
        padding: 20px;
        flex: none;
        display: block;
        overflow: visible;
    }

    .dflex-var-popup-scroll-content {
        display: block;
        overflow: visible;
        flex: none;
    }

    .dflex-var-popup-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 15px 20px;
        margin: 0;
        box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05);
        z-index: 100;
        border-top: 1px solid #f0f0f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
}


.dflex-card-stock {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: normal;
    margin-bottom: 6px;
    text-transform: none;
}

.dflex-card-stock.in-stock {
    color: #4CAF50;
}

.dflex-card-stock.low-stock {
    color: #e67c00;
}

.dflex-card-stock.out-of-stock,
.dflex-card-stock.on-order {
    color: var(--dflex-color-error, var(--color-danger, #dc3232));
}

.dflex-card-notify-btn {
    white-space: nowrap;
    cursor: pointer;
}

.woocommerce a.added_to_cart {
    display: none !important;
}

/* Out of stock button grayscale style */
.dflex-product-card .dflex-btn-add_to_cart.is-out-of-stock,
.dflex-product-card .dflex-btn-detail.is-out-of-stock,
.dflex-product-card button.is-out-of-stock {
    background: #e0e0e0 !important;
    color: #888888 !important;
    border-color: #d0d0d0 !important;
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.8;
}

/* Плашка "Товары не найдены" */
.dflex-no-products-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 40px 24px;
    text-align: center;
    margin: 20px 0;
    width: 100%;
}

.dflex-no-products-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: #EAE6DD;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777266;
}

.dflex-no-products-title {
    font-size: 22px;
    font-weight: 600;
    color: #2C2B29;
    margin-bottom: 10px;
}

.dflex-no-products-text {
    font-size: 15px;
    line-height: 1.6;
    color: #68645C;
    max-width: 480px;
    margin: 0 auto 24px;
}

.dflex-no-products-btn {
    margin-top: 10px;
}