:root {
    --dg-ink: #101828;
    --dg-muted: #667085;
    --dg-line: #e7eaf0;
    --dg-soft: #f6f7fb;
    --dg-brand: #5b45f5;
    --dg-brand-dark: #4331d8;
    --dg-success: #14804a;
}

/* Modern product cards */
.woocommerce ul.products,
.dg-modern-product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px !important;
    margin: 18px 0 26px !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product.dg-modern-product-item,
.dg-modern-product-card {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid var(--dg-line) !important;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(16, 24, 40, 0.06);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.woocommerce ul.products li.product.dg-modern-product-item:hover,
.dg-modern-product-card:hover {
    transform: translateY(-3px);
    border-color: #d8d3ff !important;
    box-shadow: 0 16px 38px rgba(16, 24, 40, 0.11);
}

.dg-modern-product-image-link,
.dg-modern-product-title-link {
    display: block;
    color: inherit;
    text-decoration: none !important;
}

.dg-modern-product-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(145deg, #fafbff 0%, #f1f3f9 100%);
}

.dg-modern-product-image-wrap img {
    width: 86% !important;
    height: 86% !important;
    margin: 0 !important;
    object-fit: contain !important;
    transition: transform .3s ease;
}

.dg-modern-product-card:hover .dg-modern-product-image-wrap img {
    transform: scale(1.045);
}

.dg-modern-discount-badge,
.dg-modern-stock-badge {
    position: absolute;
    top: 10px;
    z-index: 2;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    line-height: 1;
}

.dg-modern-discount-badge {
    left: 10px;
    background: #111827;
    color: #fff;
}

.dg-modern-stock-badge {
    right: 10px;
    background: #e9f8ef;
    color: var(--dg-success);
}

.dg-modern-stock-badge.is-out-of-stock {
    background: #fff0f0;
    color: #b42318;
}

.dg-modern-product-body {
    padding: 14px;
}

.dg-modern-product-title {
    min-height: 42px;
    margin: 0 0 10px !important;
    color: var(--dg-ink) !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.45 !important;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dg-modern-rating-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    margin-bottom: 10px;
}

.dg-modern-rating-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 7px;
    border-radius: 7px;
    background: #eaf8ef;
    color: var(--dg-success);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.dg-modern-review-count {
    color: var(--dg-muted);
    font-size: 10px;
    line-height: 1.2;
}

.dg-modern-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 28px;
    margin-bottom: 13px;
}

.dg-modern-current-price,
.dg-modern-current-price .woocommerce-Price-amount,
.dg-modern-current-price .woocommerce-Price-amount bdi {
    color: var(--dg-ink) !important;
    font-size: 18px;
    font-weight: 850;
}

.dg-modern-regular-price,
.dg-modern-regular-price .woocommerce-Price-amount,
.dg-modern-regular-price .woocommerce-Price-amount bdi {
    color: #98a2b3 !important;
    font-size: 12px;
    font-weight: 500;
    text-decoration: line-through;
}

.dg-modern-view-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--dg-brand);
    border-radius: 11px;
    background: var(--dg-brand);
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: background .2s ease, transform .2s ease;
}

.dg-modern-view-button:hover,
.dg-modern-view-button:focus {
    background: var(--dg-brand-dark);
    color: #fff !important;
    transform: translateY(-1px);
}

/* Shared flow advertisement containers */
.dg-flow-ad-slot {
    width: 100%;
    margin: 18px auto;
    padding: 10px;
    overflow: hidden;
    border: 1px solid #e9ebf2;
    border-radius: 14px;
    background: #fafbfc;
    box-sizing: border-box;
    text-align: center;
}

.dg-flow-ad-label {
    display: block;
    margin: 0 0 7px;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1;
    text-transform: uppercase;
}

.dg-flow-ad-content,
.dg-flow-ad-content > div,
.dg-flow-ad-content iframe,
.dg-flow-ad-content ins {
    max-width: 100% !important;
}

.dg-flow-ad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    overflow: hidden;
}

/* Custom product-view page */
.dg-product-page {
    min-height: 70vh;
    padding: 28px 14px 60px;
    background:
        radial-gradient(circle at top left, rgba(91, 69, 245, .10), transparent 34%),
        #f6f7fb;
}

.dg-product-page-inner {
    width: min(500px, 100%);
    margin: 0 auto;
}

.dg-product-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12px;
    color: #475467;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.dg-product-card {
    overflow: hidden;
    border: 1px solid var(--dg-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(16, 24, 40, .10);
}

.dg-product-gallery {
    padding: 16px;
    background: linear-gradient(145deg, #fbfcff, #f1f3f9);
}

.dg-product-main-image {
    display: block;
    width: 100% !important;
    aspect-ratio: 1 / 1;
    margin: 0 !important;
    border-radius: 16px;
    background: #fff;
    object-fit: contain;
}

.dg-product-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-bottom: 2px;
    overflow-x: auto;
}

.dg-product-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    padding: 4px;
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
    cursor: pointer;
}

.dg-product-content {
    padding: 22px;
}

.dg-product-kicker {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f0edff;
    color: var(--dg-brand-dark);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dg-product-title {
    margin: 11px 0 9px !important;
    color: var(--dg-ink);
    font-size: 27px !important;
    font-weight: 850 !important;
    line-height: 1.25 !important;
}

.dg-product-price-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 12px;
}

.dg-product-price,
.dg-product-price .woocommerce-Price-amount {
    color: var(--dg-ink) !important;
    font-size: 25px;
    font-weight: 900;
}

.dg-product-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.dg-product-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 12px;
    font-weight: 750;
}

.dg-product-meta-pill.is-stock {
    background: #eaf8ef;
    color: var(--dg-success);
}

.dg-product-description {
    padding-top: 18px;
    border-top: 1px solid #eef0f4;
    color: #526071;
    font-size: 14px;
    line-height: 1.75;
}

.dg-cart-success-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid #bde8cc;
    border-radius: 12px;
    background: #effaf3;
    color: #166534;
    font-size: 13px;
    line-height: 1.45;
}

.dg-product-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.dg-product-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
}

.dg-add-btn,
.dg-checkout-btn {
    background: var(--dg-brand);
    color: #fff !important;
}

.dg-add-btn:hover,
.dg-checkout-btn:hover {
    background: var(--dg-brand-dark);
    color: #fff !important;
}

.dg-shop-btn {
    background: #eef1f6;
    color: #344054 !important;
}

.dg-related-products-section {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--dg-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(16, 24, 40, .07);
}

.dg-related-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dg-related-title-row h2 {
    margin: 0 !important;
    color: var(--dg-ink);
    font-size: 20px !important;
    font-weight: 850 !important;
}

.dg-related-title-row span {
    color: var(--dg-muted);
    font-size: 11px;
}

.dg-related-products-section .dg-modern-product-grid {
    margin: 0 !important;
    gap: 10px !important;
}

.dg-related-products-section .dg-modern-product-body {
    padding: 11px;
}

.dg-related-products-section .dg-modern-product-title {
    min-height: 38px;
    font-size: 12px !important;
}

.dg-related-products-section .dg-modern-review-count {
    display: none;
}

.dg-related-products-section .dg-modern-current-price,
.dg-related-products-section .dg-modern-current-price .woocommerce-Price-amount {
    font-size: 15px;
}

.dg-related-products-section .dg-modern-view-button {
    min-height: 39px;
    font-size: 11px;
}

.woocommerce-notices-wrapper {
    width: min(500px, 100%);
    margin: 0 auto 12px;
}

/* Cart ad */
.woocommerce-cart .dg-flow-ad-cart {
    width: min(500px, calc(100% - 24px));
}

@media (min-width: 760px) {
    .woocommerce ul.products,
    .dg-modern-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px !important;
    }

    .dg-related-products-section .dg-modern-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .woocommerce ul.products,
    .dg-modern-product-grid {
        gap: 10px !important;
    }

    .woocommerce ul.products li.product.dg-modern-product-item,
    .dg-modern-product-card {
        border-radius: 14px;
    }

    .dg-modern-product-body {
        padding: 11px;
    }

    .dg-modern-product-title {
        min-height: 38px;
        font-size: 12px !important;
    }

    .dg-modern-rating-row {
        gap: 5px;
    }

    .dg-modern-review-count {
        font-size: 9px;
    }

    .dg-modern-current-price,
    .dg-modern-current-price .woocommerce-Price-amount,
    .dg-modern-current-price .woocommerce-Price-amount bdi {
        font-size: 15px;
    }

    .dg-modern-view-button {
        min-height: 40px;
        padding: 9px;
        border-radius: 9px;
        font-size: 11px;
    }

    .dg-product-page {
        padding: 16px 10px 42px;
    }

    .dg-product-card {
        border-radius: 17px;
    }

    .dg-product-content {
        padding: 17px;
    }

    .dg-product-title {
        font-size: 23px !important;
    }

    .dg-related-products-section {
        padding: 12px;
        border-radius: 16px;
    }

    .dg-flow-ad-slot {
        padding: 7px;
        border-radius: 11px;
    }
}

.woocommerce ul.products li.product.dg-modern-product-item {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.woocommerce ul.products li.product.dg-modern-product-item:hover {
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.woocommerce ul.products li.product.dg-modern-product-item .dg-loop-card-inner {
    height: 100%;
}

@media (min-width: 760px) {
    .woocommerce ul.products,
    .dg-modern-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
 * v1.3 layout hardening
 * Fixes narrow/tall WooCommerce cards and keeps automatic
 * Ad Inserter wrappers from becoming tiny product-grid cells.
 * ========================================================= */

.woocommerce .test_my_page,
.woocommerce .test_my_page > .products,
.woocommerce-page .test_my_page,
.woocommerce-page .test_my_page > .products {
    width: min(500px, 100%) !important;
    max-width: 500px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}

.woocommerce ul.products,
.woocommerce-page ul.products,
.dg-modern-product-grid {
    width: 100% !important;
    max-width: 500px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Any ad/plugin wrapper injected inside the WooCommerce loop must span the row. */
.woocommerce ul.products > :not(li.product),
.woocommerce-page ul.products > :not(li.product) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.woocommerce ul.products li.product.dg-modern-product-item,
.woocommerce-page ul.products li.product.dg-modern-product-item {
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.woocommerce ul.products li.product.dg-modern-product-item .dg-loop-card-inner,
.woocommerce-page ul.products li.product.dg-modern-product-item .dg-loop-card-inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100% !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
}

.dg-modern-product-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-width: 0 !important;
    height: auto !important;
}

.dg-modern-product-title-link,
.dg-modern-product-price-row,
.dg-modern-rating-row {
    flex: 0 0 auto;
}

.dg-modern-view-button {
    margin-top: auto !important;
}

.dg-modern-product-image-wrap {
    min-height: 0 !important;
}

.dg-modern-product-image-wrap img {
    display: block !important;
    max-width: 100% !important;
}

/* Flow ads use the existing Ad Inserter blocks without breaking 500px layouts. */
.dg-flow-ad-slot {
    width: min(500px, 100%) !important;
    max-width: 500px !important;
    min-height: 0 !important;
    margin: 18px auto !important;
    padding: 12px !important;
    overflow: visible !important;
}

.dg-flow-ad-content {
    width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
}

.dg-flow-ad-content > *,
.dg-flow-ad-content iframe,
.dg-flow-ad-content ins,
.dg-flow-ad-content [id^="google_ads_iframe"],
.dg-flow-ad-content [id^="div-gpt-ad"] {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.dg-product-view-page .site.grid-container,
body.dg-product-view-page .site-content {
    width: 100% !important;
    max-width: none !important;
}

body.dg-product-view-page .site-content {
    display: block !important;
    padding: 0 !important;
}

@media (max-width: 420px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products,
    .dg-modern-product-grid {
        gap: 9px !important;
    }

    .dg-modern-product-body {
        padding: 10px !important;
    }

    .dg-modern-discount-badge,
    .dg-modern-stock-badge {
        top: 7px;
        padding: 5px 7px;
        font-size: 8px;
    }

    .dg-modern-discount-badge {
        left: 7px;
    }

    .dg-modern-stock-badge {
        right: 7px;
    }

    .dg-modern-rating-row {
        display: none !important;
    }

    .dg-modern-product-title {
        min-height: 35px !important;
        margin-bottom: 8px !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
    }

    .dg-modern-price-row {
        margin-bottom: 9px !important;
    }

    .dg-modern-view-button {
        min-height: 38px !important;
        font-size: 10px !important;
    }

    .dg-flow-ad-slot {
        width: 100% !important;
        padding: 8px !important;
        border-radius: 10px !important;
    }
}

/* =========================================================
 * v1.4 isolated homepage grid
 * Keeps product cards full-width inside each 2-column track.
 * This intentionally avoids WooCommerce li.product float rules.
 * ========================================================= */
.dg-home-products-wrap {
    width: min(500px, calc(100% - 20px));
    max-width: 500px;
    margin: 16px auto 24px;
    box-sizing: border-box;
}

.dg-home-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    box-sizing: border-box !important;
}

.dg-home-products-grid > .dg-modern-product-card,
.dg-home-products-grid > .dg-home-product-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Any plugin output injected into the isolated grid gets a complete row. */
.dg-home-products-grid > :not(.dg-modern-product-card) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

.dg-home-products-grid .dg-modern-product-image-wrap {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
}

.dg-home-products-grid .dg-modern-product-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 13px !important;
    box-sizing: border-box !important;
}

.dg-home-products-grid .dg-modern-product-title,
.dg-home-products-grid .dg-modern-product-title-link,
.dg-home-products-grid .dg-modern-price-row,
.dg-home-products-grid .dg-modern-rating-row {
    width: 100% !important;
    min-width: 0 !important;
}

.dg-home-products-grid .dg-modern-view-button {
    width: 100% !important;
    margin-top: auto !important;
}

/* Keep manually positioned home ads outside the product card sizing rules. */
.woocommerce-shop .dg-flow-ad-home_before_products,
.woocommerce-shop .dg-flow-ad-home_after_products,
.home .dg-flow-ad-home_before_products,
.home .dg-flow-ad-home_after_products {
    clear: both !important;
    display: block !important;
    width: min(500px, calc(100% - 20px)) !important;
    max-width: 500px !important;
    margin: 16px auto !important;
}

@media (max-width: 420px) {
    .dg-home-products-wrap {
        width: calc(100% - 16px);
        margin-top: 12px;
    }

    .dg-home-products-grid {
        gap: 9px !important;
    }

    .dg-home-products-grid .dg-modern-product-body {
        padding: 10px !important;
    }

    .dg-home-products-grid .dg-modern-product-title {
        min-height: 36px !important;
        font-size: 11px !important;
    }

    .dg-home-products-grid .dg-modern-current-price,
    .dg-home-products-grid .dg-modern-current-price .woocommerce-Price-amount,
    .dg-home-products-grid .dg-modern-current-price .woocommerce-Price-amount bdi {
        font-size: 15px !important;
    }
}


/* Final two-column product layout and Products For You redesign. */
.dg-home-products-wrap,
.dg-home-products-grid {
    width: 100% !important;
    max-width: 100% !important;
}

.dg-home-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: stretch !important;
}

.dg-home-products-grid > .dg-modern-product-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    float: none !important;
    margin: 0 !important;
}

.products-for-you {
    width: 100%;
    margin: 28px 0 0;
    padding: 18px;
    border: 1px solid #e9eaf2;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(20, 28, 55, .08);
}

.products-for-you > h3 {
    margin: 0 0 16px !important;
    font-size: clamp(22px, 4vw, 30px) !important;
    line-height: 1.2 !important;
    color: #111827 !important;
}

.products-for-you .pfy-grid,
.products-for-you .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    opacity: 1;
}

.products-for-you .dg-modern-product-card,
.products-for-you .dg-pfy-modern-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    overflow: hidden;
}

.products-for-you .dg-modern-product-image-wrap {
    aspect-ratio: 1 / 1;
    min-height: 0 !important;
}

.products-for-you .dg-modern-product-body {
    padding: 12px !important;
}

.products-for-you .dg-modern-product-title {
    min-height: 42px;
    margin: 0 0 8px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-for-you .dg-modern-view-button {
    width: 100% !important;
    min-height: 42px;
    margin-top: 10px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .dg-home-products-grid,
    .products-for-you .pfy-grid,
    .products-for-you .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .products-for-you {
        padding: 12px;
        border-radius: 16px;
    }

    .dg-home-products-grid .dg-modern-product-body,
    .products-for-you .dg-modern-product-body {
        padding: 10px !important;
    }

    .dg-home-products-grid .dg-modern-rating-row,
    .products-for-you .dg-modern-rating-row {
        gap: 4px;
        flex-wrap: wrap;
    }

    .dg-home-products-grid .dg-modern-review-count,
    .products-for-you .dg-modern-review-count {
        font-size: 10px;
    }

    .dg-home-products-grid .dg-modern-current-price,
    .products-for-you .dg-modern-current-price {
        font-size: 15px !important;
    }
}


/* v1.7 - visible ad placements on every inner shopping-flow page */
.dg-flow-ad-slot {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 112px;
    margin: 18px auto;
    padding: 12px 8px 16px;
    overflow: hidden;
    clear: both;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #ffffff;
    box-sizing: border-box;
    text-align: center;
}

.dg-flow-ad-label {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 10px;
    color: #77819a;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.dg-flow-ad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 70px;
    margin: 0 auto;
    overflow: hidden;
}

.dg-flow-ad-content > div,
.dg-flow-ad-content iframe,
.dg-flow-ad-content ins,
.dg-flow-ad-content [id^="div-gpt-ad"] {
    max-width: 100% !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.dg-flow-ad-placeholder {
    width: min(100%, 336px);
    min-height: 70px;
    margin: 0 auto;
    border-radius: 10px;
    background: linear-gradient(90deg, #fafbfe, #f2f4f8, #fafbfe);
}

.dg-flow-ad-admin-note {
    display: block;
    margin: 8px auto 0;
    color: #b42318;
    font-size: 11px;
    line-height: 1.4;
}

.custom-single-product > .dg-flow-ad-slot,
.dg-product-page-inner > .dg-flow-ad-slot,
.woocommerce-cart-form .dg-flow-ad-slot {
    width: min(100%, 500px);
}

@media (max-width: 575px) {
    .dg-flow-ad-slot {
        min-height: 104px;
        margin: 14px auto;
        padding: 10px 4px 14px;
        border-radius: 10px;
    }

    .dg-flow-ad-label {
        margin-bottom: 8px;
        font-size: 8px;
        letter-spacing: 3px;
    }
}

/* =========================================================
 * Final ad + legacy Shop layout patch
 * ========================================================= */

/* The Ad Inserter block already prints its own ADVERTISEMENT label. */
.dg-flow-ad-slot {
    display: block !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 18px auto !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center !important;
}

.dg-flow-ad-slot .dg-flow-ad-label,
.dg-flow-ad-slot .dg-flow-ad-placeholder,
.dg-flow-ad-slot .dg-flow-ad-admin-note {
    display: none !important;
}

.dg-flow-ad-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* On guided checkout routes, hide Ad Inserter's automatic inline placements.
 * Only the two placements wrapped by .dg-flow-ad-slot stay visible.
 * This does not affect the separate bottom anchor unit. */
body.dg-guided-checkout-page .ads-placement-cover {
    display: none !important;
}

body.dg-guided-checkout-page .dg-flow-ad-slot .ads-placement-cover {
    display: block !important;
}

/* One full-width ad after the first four Related Products. */
.dg-related-ad-break {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
}

.dg-related-ad-break .dg-flow-ad-slot {
    width: 100% !important;
    max-width: 100% !important;
    margin: 6px auto 12px !important;
}

/* Restore the site's previous WooCommerce Shop card markup/design.
 * Only the View Product button is new. */
.woocommerce .test_my_page {
    width: min(500px, 100%) !important;
    max-width: 500px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.woocommerce .test_my_page ul.products,
.woocommerce-page .test_my_page ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce .test_my_page ul.products::before,
.woocommerce .test_my_page ul.products::after {
    display: none !important;
}

.woocommerce .test_my_page ul.products li.product,
.woocommerce-page .test_my_page ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page ul.products li.product > a.woocommerce-LoopProduct-link {
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
}

.woocommerce .test_my_page ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 0 10px !important;
    object-fit: contain !important;
}

.woocommerce .test_my_page .dg-shop-view-product-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 42px !important;
    margin: 12px 0 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #111827 !important;
    border-radius: 9px !important;
    background: #111827 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page .dg-shop-view-product-button:hover,
.woocommerce .test_my_page .dg-shop-view-product-button:focus {
    background: #ffffff !important;
    color: #111827 !important;
}

@media (max-width: 480px) {
    .woocommerce .test_my_page ul.products,
    .woocommerce-page .test_my_page ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .woocommerce .test_my_page ul.products li.product,
    .woocommerce-page .test_my_page ul.products li.product {
        padding: 9px !important;
    }

    .woocommerce .test_my_page .woocommerce-loop-product__title {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    .woocommerce .test_my_page .dg-shop-view-product-button {
        min-height: 38px !important;
        padding: 9px 7px !important;
        font-size: 11px !important;
    }
}

/* =========================================================
 * v2.0 final layout and advertisement hardening
 * ========================================================= */

/* SHOP / HOME: preserve the original simple card style, but make every
 * product a real two-column grid item with natural height. */
.woocommerce .test_my_page,
.woocommerce-page .test_my_page {
    width: min(500px, calc(100% - 16px)) !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page ul.products,
.woocommerce-page .test_my_page ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: auto !important;
    align-items: start !important;
    justify-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page ul.products > li.product,
.woocommerce-page .test_my_page ul.products > li.product {
    position: relative !important;
    display: block !important;
    align-self: start !important;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #e3e6ec !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 18px rgba(16, 24, 40, 0.05) !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page ul.products > li.product:nth-child(odd),
.woocommerce .test_my_page ul.products > li.product:nth-child(even) {
    border-right: 1px solid #e3e6ec !important;
    border-left: 1px solid #e3e6ec !important;
}

.woocommerce .test_my_page ul.products > li.product > a.woocommerce-LoopProduct-link,
.woocommerce-page .test_my_page ul.products > li.product > a.woocommerce-LoopProduct-link {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 9px !important;
    color: inherit !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page ul.products > li.product img,
.woocommerce-page .test_my_page ul.products > li.product img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 0 9px !important;
    padding: 0 !important;
    object-fit: cover !important;
    background: #f7f7f9 !important;
}

.woocommerce .test_my_page .woocommerce-loop-product__title,
.woocommerce-page .test_my_page .woocommerce-loop-product__title {
    display: -webkit-box !important;
    min-height: 41px !important;
    max-height: 41px !important;
    margin: 0 10px 7px !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #5f6673 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
}

.woocommerce .test_my_page ul.products > li.product .star-rating {
    margin: 0 10px 7px !important;
}

.woocommerce .test_my_page ul.products > li.product .price,
.woocommerce-page .test_my_page ul.products > li.product .price {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    min-height: 24px !important;
    margin: 0 10px 5px !important;
    padding: 0 !important;
    color: #111827 !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}

.woocommerce .test_my_page ul.products > li.product .price del {
    color: #9ca3af !important;
    font-size: 11px !important;
}

.woocommerce .test_my_page ul.products > li.product .off-percentage,
.woocommerce .test_my_page ul.products > li.product .discount-percentage {
    display: block !important;
    margin: 0 10px 8px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.woocommerce .test_my_page .dg-shop-view-product-button,
.woocommerce-page .test_my_page .dg-shop-view-product-button {
    position: static !important;
    inset: auto !important;
    float: none !important;
    clear: both !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: calc(100% - 20px) !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: auto !important;
    margin: 8px 10px 11px !important;
    padding: 9px 8px !important;
    border: 1px solid #111827 !important;
    border-radius: 8px !important;
    background: #111827 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: normal !important;
    transform: none !important;
    box-sizing: border-box !important;
}

.woocommerce .test_my_page .dg-shop-view-product-button:hover,
.woocommerce .test_my_page .dg-shop-view-product-button:focus {
    background: #ffffff !important;
    color: #111827 !important;
}

/* Any automatic Ad Inserter output inside the product loop receives a full
 * row and can never squeeze a product card into a narrow column. */
.woocommerce .test_my_page ul.products > :not(li.product),
.woocommerce-page .test_my_page ul.products > :not(li.product),
.woocommerce .test_my_page ul.products > .ads-placement-cover,
.woocommerce-page .test_my_page ul.products > .ads-placement-cover {
    grid-column: 1 / -1 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 5px auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Products For You and custom Related Products: two cards per row and a
 * complete advertisement row after each group of four products. */
.products-for-you .pfy-grid,
.products-for-you .product-grid,
.dg-related-products-section .dg-modern-product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
}

.products-for-you .dg-modern-product-card,
.products-for-you .dg-pfy-modern-card,
.dg-related-products-section .dg-modern-product-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
}

.products-for-you .dg-modern-product-body,
.dg-related-products-section .dg-modern-product-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
}

.products-for-you .dg-modern-view-button,
.dg-related-products-section .dg-modern-view-button {
    margin-top: auto !important;
}

.dg-pfy-ad-break,
.dg-related-ad-break {
    grid-column: 1 / -1 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 2px 0 !important;
}

.dg-pfy-ad-break .dg-flow-ad-slot,
.dg-related-ad-break .dg-flow-ad-slot {
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px auto !important;
}

/* Keep all manual blocks centered and contained within the 500px site area. */
.custom-single-product > .dg-flow-ad-slot,
.custom-single-product .dg-flow-ad-slot,
.dg-product-page-inner > .dg-flow-ad-slot,
.dg-product-page-inner .dg-flow-ad-slot,
.dg-checkout-card > .dg-flow-ad-slot {
    clear: both !important;
    width: 100% !important;
    max-width: 500px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.dg-flow-ad-content,
.dg-flow-ad-content .ads-placement-cover,
.dg-flow-ad-content [id^="div-gpt-ad"] {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: auto !important;
    margin-left: auto !important;
    text-align: center !important;
}

@media (max-width: 480px) {
    .woocommerce .test_my_page,
    .woocommerce-page .test_my_page {
        width: calc(100% - 12px) !important;
    }

    .woocommerce .test_my_page ul.products,
    .woocommerce-page .test_my_page ul.products,
    .products-for-you .pfy-grid,
    .products-for-you .product-grid,
    .dg-related-products-section .dg-modern-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .woocommerce .test_my_page .woocommerce-loop-product__title,
    .woocommerce-page .test_my_page .woocommerce-loop-product__title {
        min-height: 36px !important;
        max-height: 36px !important;
        margin-right: 8px !important;
        margin-left: 8px !important;
        font-size: 12px !important;
        line-height: 1.45 !important;
    }

    .woocommerce .test_my_page ul.products > li.product .price,
    .woocommerce-page .test_my_page ul.products > li.product .price,
    .woocommerce .test_my_page ul.products > li.product .off-percentage,
    .woocommerce .test_my_page ul.products > li.product .discount-percentage {
        margin-right: 8px !important;
        margin-left: 8px !important;
    }

    .woocommerce .test_my_page .dg-shop-view-product-button,
    .woocommerce-page .test_my_page .dg-shop-view-product-button {
        width: calc(100% - 16px) !important;
        min-height: 38px !important;
        margin: 7px 8px 9px !important;
        padding: 8px 5px !important;
        font-size: 11px !important;
    }
}

/* Inner product routes use only the manually positioned blocks above. Hide
 * Ad Inserter's automatic inline wrappers to prevent the double ad shown at
 * the top of the product page. The separate bottom anchor is unaffected. */
body.single-product .ads-placement-cover,
body.dg-product-view-page .ads-placement-cover {
    display: none !important;
}

body.single-product .dg-flow-ad-slot .ads-placement-cover,
body.dg-product-view-page .dg-flow-ad-slot .ads-placement-cover {
    display: block !important;
}

/* ================================================================
 * Home / Shop discount badge
 * Move the percentage from below the price to the image top-right.
 * ================================================================ */
.woocommerce .test_my_page ul.products > li.product,
.woocommerce-page .test_my_page ul.products > li.product {
    position: relative !important;
}

.woocommerce .test_my_page .dg-home-loop-discount-badge,
.woocommerce-page .test_my_page .dg-home-loop-discount-badge {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    z-index: 12 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 56px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 5px 9px !important;
    border: 1px solid rgba(255, 255, 255, 0.78) !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #ff3d6e 0%, #ff6a3d 100%) !important;
    box-shadow: 0 7px 18px rgba(255, 61, 110, 0.30) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: 0.2px !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}

/* Remove the old percentage text below the price on these product cards. */
.woocommerce .test_my_page ul.products > li.product .off-percentage,
.woocommerce-page .test_my_page ul.products > li.product .off-percentage,
.woocommerce .test_my_page ul.products > li.product .discount-percentage,
.woocommerce-page .test_my_page ul.products > li.product .discount-percentage {
    display: none !important;
}

/* Avoid showing WooCommerce's default sale badge together with the custom one. */
.woocommerce .test_my_page ul.products > li.product .onsale,
.woocommerce-page .test_my_page ul.products > li.product .onsale {
    display: none !important;
}

@media (max-width: 480px) {
    .woocommerce .test_my_page .dg-home-loop-discount-badge,
    .woocommerce-page .test_my_page .dg-home-loop-discount-badge {
        top: 14px !important;
        right: 14px !important;
        min-width: 48px !important;
        min-height: 24px !important;
        padding: 4px 7px !important;
        font-size: 9px !important;
    }
}

/* ========================================================================== 
   500px floating cart button and redesigned cart page
   ========================================================================== */
.dg-floating-cart-frame {
    position: fixed;
    z-index: 9998;
    top: 84px;
    right: max(12px, calc((100vw - 500px) / 2 + 12px));
    width: 52px;
    height: 52px;
    opacity: 1;
    pointer-events: none;
}

body.admin-bar .dg-floating-cart-frame {
    top: 116px;
}

.dg-floating-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(16, 24, 40, .1);
    border-radius: 15px;
    background: #101828;
    color: #fff !important;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .22);
    text-decoration: none !important;
    pointer-events: auto;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.dg-floating-cart:hover {
    color: #fff !important;
    background: #253047;
    transform: translateY(-2px);
    box-shadow: 0 15px 34px rgba(16, 24, 40, .28);
}

.dg-floating-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dg-floating-cart-count {
    position: absolute;
    top: -7px;
    right: -7px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-sizing: border-box;
}

body.woocommerce-cart .widget-area {
    display: none !important;
}

body.woocommerce-cart #page,
body.woocommerce-cart .site-content,
body.woocommerce-cart .content-area,
body.woocommerce-cart main.site-main {
    width: 100% !important;
    max-width: 500px !important;
    margin-right: auto !important;
    margin-left: auto !important;
    box-sizing: border-box;
}

body.woocommerce-cart .site-content {
    display: block !important;
    padding: 18px 12px 38px !important;
}

.dg-cart-form {
    width: 100%;
    margin: 0;
}

.dg-cart-shell,
.dg-cart-empty {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid #e7eaf0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(16, 24, 40, .09);
    box-sizing: border-box;
}

.dg-cart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.dg-cart-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.dg-cart-heading h1,
.dg-cart-empty h1 {
    margin: 0 !important;
    color: #101828;
    font-size: 26px !important;
    font-weight: 900 !important;
    line-height: 1.15;
}

.dg-cart-item-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.dg-cart-items {
    display: grid;
    gap: 12px;
}

.dg-cart-product {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
    min-height: 0 !important;
    height: auto !important;
    padding: 12px;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .055);
    box-sizing: border-box;
}

.dg-cart-product-image,
.dg-cart-product-image a {
    display: block;
    width: 92px;
    height: 112px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f6f8;
}

.dg-cart-product-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover;
}

.dg-cart-product-content {
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    gap: 7px;
    min-width: 0;
    min-height: 0;
}

.dg-cart-product-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.dg-cart-product-title {
    min-width: 0;
    margin: 0 !important;
    color: #101828;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.35;
}

.dg-cart-product-title a {
    display: -webkit-box;
    overflow: hidden;
    color: inherit !important;
    text-decoration: none !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dg-cart-remove-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff5f5;
    color: #c62828 !important;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
}

.dg-cart-remove-button:hover {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b !important;
}

.dg-cart-product-meta {
    margin: 0;
    color: #667085;
    font-size: 10px;
}

.dg-cart-product-meta:empty {
    display: none;
}

.dg-cart-product-meta dl,
.dg-cart-product-meta p {
    margin: 0;
}

.dg-cart-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 0;
    padding-top: 2px;
}

.dg-cart-product-price,
.dg-cart-product-price .woocommerce-Price-amount {
    color: #101828 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.dg-cart-quantity-control,
.dg-cart-quantity-static {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
}

.dg-cart-quantity-control select {
    width: 54px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #fff;
    color: #101828;
    font-size: 12px;
    font-weight: 800;
}

.dg-cart-hidden-update {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.dg-cart-summary {
    margin-top: 16px;
    padding: 15px;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    background: #f8fafc;
}

.dg-cart-summary h2 {
    margin: 0 0 12px !important;
    color: #101828;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.dg-cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    color: #475467;
    font-size: 13px;
}

.dg-cart-summary-row strong {
    color: #101828;
    font-weight: 850;
}

.dg-cart-summary-row.is-total {
    margin-top: 5px;
    padding-top: 12px;
    border-top: 1px dashed #d0d5dd;
    color: #101828;
    font-size: 15px;
    font-weight: 850;
}

.dg-cart-free-text {
    color: #15803d !important;
}

.dg-cart-actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 10px;
    margin-top: 14px;
}

.dg-cart-primary-button,
.dg-cart-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
    text-decoration: none !important;
    box-sizing: border-box;
}

.dg-cart-primary-button {
    border: 1px solid #101828;
    background: #101828;
    color: #fff !important;
}

.dg-cart-primary-button:hover {
    background: #253047;
    color: #fff !important;
}

.dg-cart-secondary-button {
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054 !important;
}

.dg-cart-secondary-button:hover {
    border-color: #98a2b3;
    background: #f8fafc;
    color: #101828 !important;
}

.dg-cart-empty {
    text-align: center;
}

.dg-cart-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 14px;
    border-radius: 22px;
    background: #f2f4f7;
    color: #667085;
}

.dg-cart-empty p {
    margin: 8px 0 20px;
    color: #667085;
    font-size: 13px;
}

body.woocommerce-cart .dg-flow-ad-slot {
    width: min(500px, calc(100% - 24px)) !important;
    margin-right: auto !important;
    margin-left: auto !important;
}


@media (max-width: 540px) {
    .dg-floating-cart-frame {
        right: 10px;
        width: 47px;
        height: 47px;
    }

    .dg-floating-cart {
        width: 45px;
        height: 45px;
        border-radius: 13px;
    }

    body.woocommerce-cart .site-content {
        padding: 12px 8px 28px !important;
    }

    .dg-cart-shell,
    .dg-cart-empty {
        padding: 14px;
        border-radius: 18px;
    }

    .dg-cart-product {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .dg-cart-product-image,
    .dg-cart-product-image a {
        width: 82px;
        height: 104px;
    }

    .dg-cart-remove-button span {
        display: none;
    }

    .dg-cart-remove-button {
        width: 29px;
        padding: 5px;
        justify-content: center;
    }

    .dg-cart-actions {
        grid-template-columns: 1fr;
    }
}


/* Final cart and advertisement-label corrections. */
.dg-flow-ad-slot .dg-duplicate-ad-label,
.ads-placement-cover .dg-duplicate-ad-label {
    display: none !important;
}

body.woocommerce-cart .dg-cart-product {
    align-items: center !important;
}

body.woocommerce-cart .dg-cart-product-content {
    align-self: stretch;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

body.woocommerce-cart .dg-cart-product-bottom {
    margin-top: auto;
}

@media (max-width: 782px) {
    body.admin-bar .dg-floating-cart-frame {
        top: 130px;
    }
}

@media (max-width: 540px) {
    .dg-floating-cart-frame {
        top: 82px;
        right: 10px;
    }

    body.admin-bar .dg-floating-cart-frame {
        top: 128px;
    }

    body.woocommerce-cart .dg-cart-product {
        grid-template-columns: 88px minmax(0, 1fr) !important;
        align-items: center !important;
    }

    body.woocommerce-cart .dg-cart-product-image,
    body.woocommerce-cart .dg-cart-product-image a {
        width: 88px !important;
        height: 108px !important;
    }
}


/* ========================================================================== 
   Final cart URL / label flash / compact cart corrections
   ========================================================================== */

/* The cart button must remain fixed under the header inside the 500px frame. */
.dg-floating-cart-frame {
    position: fixed !important;
    top: 84px !important;
    right: max(12px, calc((100vw - 500px) / 2 + 12px)) !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
}

body.admin-bar .dg-floating-cart-frame {
    top: 116px !important;
}

/* Keep each cart item compact; never stretch content to create blank space. */
body.woocommerce-cart .dg-cart-product {
    align-items: start !important;
    min-height: 0 !important;
    height: auto !important;
}

body.woocommerce-cart .dg-cart-product-content {
    align-self: start !important;
    display: grid !important;
    grid-template-rows: auto auto auto !important;
    align-content: start !important;
    justify-content: initial !important;
    gap: 7px !important;
    min-height: 0 !important;
    height: auto !important;
}

body.woocommerce-cart .dg-cart-product-bottom {
    margin-top: 2px !important;
}

@media (max-width: 782px) {
    body.admin-bar .dg-floating-cart-frame {
        top: 128px !important;
    }
}

@media (max-width: 540px) {
    .dg-floating-cart-frame {
        top: 82px !important;
        right: 10px !important;
    }

    body.admin-bar .dg-floating-cart-frame {
        top: 128px !important;
    }
}
