.dugg-home-products {
    background: #f6f7f5;
    color: #111827;
}

.dugg-home-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.dugg-shop-head {
    padding: 28px 0 18px;
}

.dugg-shop-head h1 {
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
}

.dugg-shop-head p {
    margin-top: 8px;
    color: #5f6b61;
    font-size: 15px;
}

.dugg-category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 20px;
    scrollbar-width: none;
}

.dugg-category-tabs::-webkit-scrollbar {
    display: none;
}

.dugg-category-tabs a,
.dugg-category-tabs button {
    flex: 0 0 auto;
    border: 1px solid #d7ded7;
    border-radius: 8px;
    background: #fff;
    padding: 10px 16px;
    color: #18231b;
    font-weight: 700;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.dugg-category-tabs a.is-active,
.dugg-category-tabs button.is-active {
    background: #1f7a3a;
    border-color: #1f7a3a;
    color: #fff;
}

.dugg-product-section {
    padding: 14px 0 34px;
    scroll-margin-top: 150px;
}

.dugg-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.dugg-section-head h2 {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
}

.dugg-section-head a {
    color: #ef5b18;
    font-weight: 700;
    text-decoration: none;
}

.dugg-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dugg-product-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e5df;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}

.dugg-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(31, 42, 33, .12);
}

html.dugg-ios-browser .dugg-product-card,
html.dugg-ios-browser .dugg-product-card:hover,
html.dugg-ios-browser .dugg-product-card *,
html.dugg-ios-browser .dugg-product-image,
html.dugg-ios-browser .dugg-product-image img {
    transition: none !important;
    transform: none !important;
    will-change: auto !important;
}

html.dugg-ios-browser .dugg-product-card {
    contain: none !important;
    box-shadow: none !important;
}

html.dugg-ios-browser .dugg-product-cart-button,
html.dugg-ios-browser .dugg-product-cart-button.is-active,
html.dugg-ios-browser .dugg-product-qty-control,
html.dugg-ios-browser .dugg-wishlist-button {
    box-shadow: none !important;
    filter: none !important;
}

html.dugg-android-browser,
html.dugg-android-browser body {
    scroll-behavior: auto;
}

@media (max-width: 720px) {
    html.dugg-android-browser .dugg-category-tabs {
        box-shadow: none;
    }

    html.dugg-android-browser .dugg-product-grid {
        align-items: start;
    }

    html.dugg-android-browser .dugg-product-card,
    html.dugg-android-browser .dugg-product-card:hover,
    html.dugg-android-browser .dugg-product-card *,
    html.dugg-android-browser .dugg-product-image,
    html.dugg-android-browser .dugg-product-image img {
        transition: none !important;
        transform: none !important;
        will-change: auto !important;
    }

    html.dugg-android-browser .dugg-product-card:hover,
    html.dugg-android-browser .dugg-product-cart-button,
    html.dugg-android-browser .dugg-product-cart-button.is-active,
    html.dugg-android-browser .dugg-product-qty-control,
    html.dugg-android-browser .dugg-wishlist-button {
        box-shadow: none !important;
        filter: none !important;
    }
}

@media (max-width: 720px) {
    html.dugg-android-browser,
    html.dugg-android-browser body {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    html.dugg-android-browser .dugg-product-grid {
        contain: layout paint;
        will-change: scroll-position;
        transform: translateZ(0);
    }

    html.dugg-android-browser .dugg-product-card {
        contain: layout paint style;
        backface-visibility: hidden;
    }

    html.dugg-android-browser .dugg-product-image,
    html.dugg-android-browser .dugg-product-image img {
        backface-visibility: hidden;
    }

    /* Disable pointer events during batch append to reduce hit-testing */
    html.dugg-android-browser .dugg-product-grid.is-dugg-appending {
        pointer-events: none;
    }
}


@media (max-width: 720px) {
    /* Android: hide non-essential fixed elements to reduce repaint cost */
    html.dugg-android-browser .dugg-customer-service,
    html.dugg-android-browser .dugg-floating-cart,
    html.dugg-android-browser .dugg-favorites {
        transition: opacity 0.15s ease !important;
    }
    
    /* When scrolling (added via JS), fade out floating elements */

    
    /* Use transform instead of top/left for fixed elements */
    html.dugg-android-browser .dugg-mobile-brand-ribbon {
        transform: translateZ(0) !important;
        will-change: transform !important;
    }
}

@media (max-width: 720px) {
    html.dugg-android-browser header.sticky,
    html.dugg-android-browser .dugg-mobile-header,
    html.dugg-android-browser .dugg-header {
        position: relative !important;
        top: auto !important;
        transform: none !important;
        will-change: auto !important;
    }

    html.dugg-android-browser .dugg-mobile-brand-ribbon {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10080 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: var(--dugg-mobile-fixed-ribbon-height, 78px) !important;
        min-height: var(--dugg-mobile-fixed-ribbon-height, 78px) !important;
        max-height: var(--dugg-mobile-fixed-ribbon-height, 78px) !important;
        transform: none !important;
        will-change: auto !important;
        contain: layout paint !important;
    }

}

@supports (content-visibility: auto) {
    @media (max-width: 720px) {
        html.dugg-android-browser .dugg-product-card {
            content-visibility: auto;
            contain-intrinsic-size: 430px 520px;
        }
    }
}

@media (max-width: 720px) {
    /* Keep Android WeChat's long product list out of oversized GPU layers. */
    html.dugg-android-wechat .dugg-product-grid {
        transform: none !important;
        will-change: auto !important;
    }

    html.dugg-android-wechat .dugg-product-card,
    html.dugg-android-wechat .dugg-product-image,
    html.dugg-android-wechat .dugg-product-image img {
        backface-visibility: visible !important;
    }
}

.dugg-product-card.is-dugg-hidden,
.dugg-empty-section.is-dugg-hidden {
    display: none !important;
}

.dugg-home-load-sentinel {
    width: 100%;
    height: 1px;
    pointer-events: none;
}

.dugg-product-image {
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #ffffff;
}

.dugg-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

.dugg-image-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #708070;
    font-weight: 700;
}

.dugg-product-info {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 164px;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 12px 54px;
}

.dugg-product-info a {
    color: inherit;
    text-decoration: none;
}

.dugg-product-name {
    min-height: 44px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dugg-product-action-row {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    min-height: 42px;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 4px;
}

.dugg-product-cart-button {
    display: inline-flex;
    width: auto !important;
    min-width: 78px;
    max-width: 112px;
    min-height: 36px;
    flex: 0 1 45%;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0 14px;
    background: #ff6a00;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(255, 106, 0, .24);
    cursor: pointer;
    transition: transform .16s ease, opacity .16s ease, background .16s ease;
}

.dugg-product-cart-button:hover {
    background: #e85d00;
    transform: translateY(-1px);
}

.dugg-product-cart-button.is-active {
    background: #16a34a;
    box-shadow: 0 8px 18px rgba(22, 163, 74, .22);
}

.dugg-product-cart-button.is-active:hover {
    background: #15803d;
}

.dugg-product-cart-button:disabled {
    cursor: wait;
    opacity: .68;
    transform: none;
}

.dugg-product-qty-control {
    display: inline-flex;
    width: auto !important;
    min-height: 36px;
    flex: 0 0 auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #222831;
    box-shadow: 0 4px 12px rgba(17, 24, 39, .08);
}

.dugg-product-qty-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #222831;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.dugg-product-qty-button:disabled {
    cursor: not-allowed;
    color: #c4c8cf;
}

.dugg-product-qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
}

.dugg-wishlist-button {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #4b5563;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(17, 24, 39, .12);
}

.dugg-wishlist-button:hover,
.dugg-wishlist-button.is-active {
    color: #ef4444;
}

html.dugg-home-mobile-fixed-shell .dugg-wishlist-button {
    left: 8px;
    bottom: 5px;
}

.dugg-product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    align-self: flex-start;
    gap: 0;
    margin-top: 0;
    color: #222831;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.dugg-product-price .dugg-retail-price {
    display: none !important;
}

.dugg-product-price .dugg-wholesale-price {
    color: #222831;
}

.dugg-product-price .dugg-unit {
    color: #6b756c;
    font-size: 13px;
    font-weight: 600;
}

.dugg-empty-section {
    border: 1px dashed #d3d9d1;
    border-radius: 8px;
    background: #fff;
    padding: 26px;
    color: #687368;
    text-align: center;
}

.dugg-wishlist-toast {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 60;
    border-radius: 8px;
    background: #17231a;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 14px 28px rgba(17, 24, 39, .18);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.dugg-wishlist-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .dugg-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .dugg-home-inner {
        width: min(100% - 20px, 1180px);
    }

    .dugg-category-tabs {
        position: relative;
        top: auto;
        z-index: 1;
        margin: 0;
        padding: 10px 0 12px;
        background: #f7f8f5;
        box-shadow: 0 8px 18px rgba(17, 24, 39, .08);
    }

    .dugg-product-section {
        scroll-margin-top: calc(var(--dugg-category-tabs-top, 0px) + 16px);
    }

    .dugg-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dugg-product-info {
        min-height: 146px;
        padding: 10px;
    }

    .dugg-product-name {
        min-height: 38px;
        font-size: 14px;
    }

    .dugg-product-action-row {
        flex-wrap: nowrap;
        gap: 6px;
        min-height: 40px;
        margin-top: auto;
    }

    .dugg-product-cart-button {
        min-width: 68px;
        max-width: 90px;
        min-height: 34px;
        flex: 0 1 46%;
        padding: 0 10px;
        font-size: 14px;
    }

    .dugg-product-qty-control {
        width: auto !important;
        min-height: 34px;
        flex: 0 0 auto;
    }

    .dugg-product-qty-button {
        width: 30px;
        height: 32px;
        font-size: 17px;
    }

    .dugg-product-price {
        position: static;
        margin: auto 0 0;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .dugg-home-inner {
        width: min(100% - 16px, 1180px);
    }

    .dugg-category-tabs {
        margin: 0;
        padding-inline: 0;
    }

    .dugg-product-grid {
        gap: 8px;
    }

    .dugg-product-info {
        min-height: 136px;
        padding: 8px;
    }

    .dugg-product-name {
        min-height: 34px;
        font-size: 13px;
        line-height: 1.28;
    }

    .dugg-product-action-row {
        gap: 5px;
        min-height: 34px;
        margin-top: auto;
        margin-bottom: 2px;
    }

    .dugg-product-cart-button {
        min-width: 58px;
        max-width: 78px;
        min-height: 30px;
        padding: 0 8px;
        font-size: 13px;
    }

    .dugg-product-qty-control {
        min-height: 30px;
    }

    .dugg-product-qty-button {
        width: 26px;
        height: 28px;
        font-size: 16px;
    }

    .dugg-product-qty-value {
        min-width: 16px;
        font-size: 13px;
    }

    .dugg-product-price {
        gap: 0;
        margin: auto 0 0;
        font-size: 13px;
        line-height: 1;
    }

    .dugg-product-price .dugg-unit {
        font-size: 12px;
    }
}
    
    /* Android: during scroll, reduce paint cost */
    html.dugg-android-browser.is-dugg-scrolling .dugg-product-card {
        box-shadow: none !important;
    }
    html.dugg-android-browser.is-dugg-scrolling .dugg-customer-service,
    html.dugg-android-browser.is-dugg-scrolling .dugg-floating-cart,
    html.dugg-android-browser.is-dugg-scrolling .dugg-favorites,
    html.dugg-android-browser.is-dugg-scrolling .dugg-share-buttons {
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }
    html.dugg-android-browser.is-dugg-scrolling .dugg-pull-refresh {
        display: none !important;
    }
    /* Reduce border-radius paint during scroll */
    html.dugg-android-browser.is-dugg-scrolling .dugg-product-image img {
        border-radius: 0 !important;
    }
