.deco-cart-success-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.48);
}

.deco-cart-success-backdrop.is-visible {
    display: flex;
}

body.deco-cart-success-open {
    overflow: hidden;
}

.deco-cart-success-dialog {
    position: relative;
    width: min(520px, 94vw);
    padding: 30px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.deco-cart-success-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.deco-cart-success-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #f3212b;
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    line-height: 62px;
}

.deco-cart-success-dialog h3 {
    margin: 0 0 8px;
    font-size: 25px;
    line-height: 1.25;
}

.deco-cart-success-dialog p {
    margin: 0 0 22px;
    color: #555;
    font-size: 16px;
}

.deco-cart-success-actions {
    display: grid;
    gap: 11px;
}

.deco-cart-success-actions a,
.deco-cart-success-actions button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 13px 16px;
    border: 0;
    border-radius: 7px;
    box-sizing: border-box;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
}

.deco-cart-success-continue {
    background: #f1f1f1;
    color: #222;
}

.deco-cart-success-view-cart {
    background: #333;
    color: #fff !important;
}

.deco-cart-success-checkout {
    background: #f3212b;
    color: #fff !important;
}

.deco-cart-success-dialog.deco-smart-dialog {
    width: min(1040px, 96vw);
    max-height: 94vh;
    overflow-y: auto;
    padding: 24px;
    text-align: left;
}

.deco-smart-dialog .deco-smart-close {
    top: 14px;
    right: 18px;
    color: #111;
    font-size: 38px;
}

.deco-smart-success {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-right: 48px;
    margin-bottom: 18px;
}

.deco-smart-check {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #49a927;
    color: #fff;
    font-size: 48px;
    font-weight: 800;
}

.deco-smart-success > div:last-child {
    display: flex;
    flex-direction: column;
    font-size: clamp(23px, 3vw, 39px);
    font-weight: 800;
    line-height: 1.04;
}

.deco-smart-success strong {
    color: #3d9225;
}

.deco-smart-added-product {
    display: grid;
    grid-template-columns: 170px 1fr 190px;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    border: 2px solid #3d9225;
    border-radius: 9px;
}

.deco-smart-added-product img {
    width: 100%;
    height: 120px;
    object-fit: contain;
}

.deco-smart-added-name {
    font-size: 27px;
    font-weight: 800;
    line-height: 1.2;
}

.deco-smart-added-name span,
.deco-smart-added-name b {
    display: block;
    margin-top: 7px;
}

.deco-smart-added-name span {
    font-size: 17px;
    font-weight: 600;
}

.deco-smart-added-name b {
    width: max-content;
    padding: 4px 14px;
    border-radius: 5px;
    background: #e5f1df;
    color: #3d9225;
    font-size: 18px;
}

.deco-smart-coverage {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #bbb;
    text-align: center;
}

.deco-smart-coverage span {
    font-weight: 800;
}

.deco-smart-coverage strong {
    color: #3d9225;
    font-size: 35px;
}

.deco-smart-coverage small {
    font-weight: 600;
}

.deco-smart-heading {
    display: flex;
    flex-direction: column;
    margin: 22px 0 14px;
}

.deco-smart-heading strong {
    font-size: 23px;
}

.deco-smart-heading span {
    font-size: 17px;
}

.deco-smart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.deco-smart-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.deco-smart-card img {
    width: 100%;
    height: 155px;
    object-fit: contain;
}

.deco-smart-card h3 {
    margin: 8px 0 2px;
    font-size: 19px;
}

.deco-smart-card-subtitle {
    margin: 0 0 10px !important;
    color: #444 !important;
    font-size: 15px !important;
}

.deco-smart-recommendation {
    min-height: 66px;
    padding: 10px;
    border: 1px solid #bedcae;
    border-radius: 6px;
    background: #eff7ea;
    font-size: 18px;
}

.deco-smart-recommendation strong {
    display: block;
    color: #3d9225;
}

.deco-smart-recommendation span {
    display: block;
    font-size: 15px;
}

.deco-smart-price {
    min-height: 25px;
    margin: 10px 0;
    font-size: 18px;
    font-weight: 700;
}

.deco-smart-primary,
.deco-smart-secondary,
.deco-smart-actions a {
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none !important;
    font-weight: 800;
}

.deco-smart-primary {
    background: #f3212b;
    color: #fff !important;
}

.deco-smart-secondary {
    margin-top: 8px;
    border: 1px solid #aaa;
    color: #222 !important;
}

.deco-smart-card small {
    margin-top: 6px;
    text-align: center;
}

.deco-smart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 14px;
    margin-top: 20px;
}

.deco-smart-actions a {
    border: 1px solid #aaa;
    color: #222 !important;
}

.deco-smart-actions .deco-smart-checkout {
    border-color: #f3212b;
    background: #f3212b;
    color: #fff !important;
}

@media (min-width: 620px) {
    .deco-cart-success-actions {
        grid-template-columns: 1fr 1fr;
    }

    .deco-cart-success-checkout {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .deco-cart-success-dialog.deco-smart-dialog {
        padding: 17px;
    }

    .deco-smart-success {
        align-items: flex-start;
    }

    .deco-smart-check {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        font-size: 36px;
    }

    .deco-smart-added-product {
        grid-template-columns: 90px 1fr;
    }

    .deco-smart-coverage {
        grid-column: 1 / -1;
        padding-top: 10px;
        border-top: 1px solid #ddd;
        border-left: 0;
    }

    .deco-smart-grid,
    .deco-smart-actions {
        grid-template-columns: 1fr;
    }

    .deco-smart-card img {
        height: 130px;
    }
}


/* v1.2.2 compact desktop presentation */
@media (min-width: 761px) {
    .deco-cart-success-backdrop {
        padding: 12px;
    }

    .deco-cart-success-dialog.deco-smart-dialog {
        width: min(920px, 94vw);
        max-height: 92vh;
        padding: 16px 18px 14px;
        border-radius: 10px;
    }

    .deco-smart-dialog .deco-smart-close {
        top: 8px;
        right: 10px;
        width: 34px;
        height: 34px;
        font-size: 30px;
    }

    .deco-smart-success {
        gap: 12px;
        margin-bottom: 10px;
        padding-right: 42px;
    }

    .deco-smart-check {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
        font-size: 34px;
    }

    .deco-smart-success > div:last-child {
        font-size: clamp(22px, 2.2vw, 31px);
        line-height: 1;
    }

    .deco-smart-added-product {
        grid-template-columns: 100px 1fr 145px;
        gap: 14px;
        padding: 10px 14px;
    }

    .deco-smart-added-product img {
        height: 78px;
    }

    .deco-smart-added-name {
        font-size: 21px;
        line-height: 1.12;
    }

    .deco-smart-added-name span {
        margin-top: 4px;
        font-size: 14px;
    }

    .deco-smart-added-name b {
        margin-top: 5px;
        padding: 3px 10px;
        font-size: 15px;
    }

    .deco-smart-coverage strong {
        font-size: 28px;
    }

    .deco-smart-coverage small {
        font-size: 12px;
    }

    .deco-smart-heading {
        margin: 13px 0 8px;
    }

    .deco-smart-heading strong {
        font-size: 19px;
    }

    .deco-smart-heading span {
        font-size: 14px;
    }

    .deco-smart-grid {
        gap: 10px;
    }

    .deco-smart-card {
        padding: 9px;
    }

    .deco-smart-card img {
        height: 105px;
    }

    .deco-smart-card h3 {
        margin: 5px 0 1px;
        font-size: 16px;
        line-height: 1.15;
    }

    .deco-smart-card-subtitle {
        margin-bottom: 6px !important;
        font-size: 12px !important;
        line-height: 1.2;
    }

    .deco-smart-recommendation {
        min-height: 50px;
        padding: 7px 8px;
        font-size: 15px;
        line-height: 1.2;
    }

    .deco-smart-recommendation span {
        font-size: 12px;
    }

    .deco-smart-price {
        min-height: 20px;
        margin: 6px 0;
        font-size: 15px;
    }

    .deco-smart-primary,
    .deco-smart-secondary {
        padding: 8px 9px;
        font-size: 14px;
    }

    .deco-smart-secondary {
        margin-top: 5px;
    }

    .deco-smart-card small {
        margin-top: 4px;
        font-size: 11px;
    }

    .deco-smart-actions {
        gap: 9px;
        margin-top: 11px;
    }

    .deco-smart-actions a {
        padding: 9px 10px;
        font-size: 14px;
    }
}


/* v1.2.3 final compact popup sizing */
@media (min-width: 761px) {
    .deco-cart-success-backdrop {
        padding: 10px;
    }

    .deco-cart-success-dialog.deco-smart-dialog {
        width: min(860px, 90vw);
        max-height: 84vh;
        padding: 12px 14px 12px;
        border-radius: 9px;
        overflow-y: auto;
    }

    .deco-smart-dialog .deco-smart-close {
        top: 7px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 27px;
    }

    .deco-smart-success {
        gap: 9px;
        margin-bottom: 8px;
        padding-right: 38px;
    }

    .deco-smart-check {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        font-size: 29px;
    }

    .deco-smart-success > div:last-child {
        font-size: clamp(19px, 1.9vw, 27px);
        line-height: 0.98;
    }

    .deco-smart-added-product {
        grid-template-columns: 78px 1fr 128px;
        gap: 10px;
        padding: 8px 10px;
    }

    .deco-smart-added-product img {
        height: 62px;
    }

    .deco-smart-added-name {
        font-size: 18px;
        line-height: 1.08;
    }

    .deco-smart-added-name span {
        margin-top: 3px;
        font-size: 12px;
    }

    .deco-smart-added-name b {
        margin-top: 4px;
        padding: 2px 8px;
        font-size: 13px;
    }

    .deco-smart-coverage span {
        font-size: 12px;
    }

    .deco-smart-coverage strong {
        font-size: 24px;
    }

    .deco-smart-coverage small {
        font-size: 10px;
    }

    .deco-smart-heading {
        margin: 9px 0 6px;
    }

    .deco-smart-heading strong {
        font-size: 17px;
    }

    .deco-smart-heading span {
        font-size: 12px;
    }

    .deco-smart-grid {
        gap: 8px;
    }

    .deco-smart-card {
        padding: 7px;
        border-radius: 6px;
    }

    .deco-smart-card img {
        height: 82px;
    }

    .deco-smart-card h3 {
        margin: 4px 0 1px;
        font-size: 14px;
        line-height: 1.08;
    }

    .deco-smart-card-subtitle {
        margin-bottom: 4px !important;
        font-size: 10px !important;
        line-height: 1.1;
    }

    .deco-smart-recommendation {
        min-height: 42px;
        padding: 5px 6px;
        font-size: 13px;
        line-height: 1.12;
    }

    .deco-smart-recommendation strong {
        font-size: 13px;
    }

    .deco-smart-recommendation span {
        font-size: 10px;
    }

    .deco-smart-price {
        min-height: 17px;
        margin: 4px 0;
        font-size: 13px;
    }

    .deco-smart-primary,
    .deco-smart-secondary {
        padding: 6px 7px;
        font-size: 12px;
        line-height: 1.1;
    }

    .deco-smart-secondary {
        margin-top: 4px;
    }

    .deco-smart-card small {
        margin-top: 3px;
        font-size: 9px;
    }

    .deco-smart-actions {
        gap: 7px;
        margin-top: 8px;
    }

    .deco-smart-actions a {
        padding: 7px 8px;
        font-size: 12px;
        line-height: 1.1;
    }
}

@media (min-width: 1200px) and (min-height: 800px) {
    .deco-cart-success-dialog.deco-smart-dialog {
        width: min(900px, 86vw);
        max-height: 82vh;
    }
}


/* v1.2.4 unit-price wording and card alignment */
.deco-smart-card {
    height: 100%;
}

.deco-smart-card h3 {
    min-height: 2.2em;
}

.deco-smart-card-subtitle {
    min-height: 1.2em;
}

.deco-smart-recommendation {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.deco-smart-price {
    margin-top: auto;
}

.deco-smart-primary,
.deco-smart-secondary {
    flex: 0 0 auto;
}

.deco-smart-unit {
    font-size: 0.78em;
    font-weight: 600;
    white-space: nowrap;
}

.deco-smart-price-line {
    display: block;
    line-height: 1.25;
}

.deco-smart-recommendation span {
    display: block;
}

@media (min-width: 761px) {
    .deco-smart-grid {
        align-items: stretch;
    }

    .deco-smart-card {
        display: flex;
        flex-direction: column;
    }

    .deco-smart-card img {
        flex: 0 0 auto;
    }

    .deco-smart-recommendation {
        min-height: 50px;
    }

    .deco-smart-price {
        min-height: 34px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .deco-smart-primary {
        margin-top: 0;
    }
}


/* v1.2.5 action-row separation and border cleanup */
.deco-smart-grid {
    margin-bottom: 12px;
}

.deco-smart-actions {
    position: relative;
    z-index: 3;
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid #e4e4e4;
    background: #fff;
}

.deco-smart-card {
    overflow: hidden;
}

.deco-smart-price {
    min-height: 42px;
}

.deco-smart-price-line {
    display: block;
    line-height: 1.18;
}

@media (min-width: 761px) {
    .deco-smart-grid {
        margin-bottom: 10px;
    }

    .deco-smart-actions {
        padding-top: 7px;
    }
}


/* v1.2.6 price positioning, unit labels and button alignment */
.deco-smart-unit {
    display: inline !important;
    font-size: 0.82em !important;
    font-weight: 700 !important;
    white-space: normal !important;
    color: #333 !important;
}

.deco-smart-price-line {
    display: block !important;
    line-height: 1.25 !important;
}

.deco-smart-price {
    margin: 6px 0 7px !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
}

@media (min-width: 761px) {
    .deco-smart-card {
        display: grid !important;
        grid-template-rows:
            82px
            minmax(2.25em, auto)
            minmax(1.2em, auto)
            minmax(50px, auto)
            auto
            auto
            auto
            auto;
        align-content: start;
        height: 100%;
    }

    .deco-smart-card img {
        align-self: center;
        justify-self: center;
    }

    .deco-smart-card h3,
    .deco-smart-card-subtitle,
    .deco-smart-recommendation,
    .deco-smart-price,
    .deco-smart-primary,
    .deco-smart-secondary,
    .deco-smart-card small {
        margin-left: 0;
        margin-right: 0;
    }

    .deco-smart-recommendation {
        margin-bottom: 0 !important;
    }

    .deco-smart-primary {
        margin-top: 0 !important;
    }

    .deco-smart-secondary {
        margin-top: 4px !important;
    }
}


/* v1.2.7 move prices into the product heading area */
.deco-smart-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    margin: 5px 0 7px;
}

.deco-smart-card-copy {
    min-width: 0;
}

.deco-smart-card-heading h3 {
    min-height: 0;
    margin: 0 0 2px;
}

.deco-smart-card-heading .deco-smart-card-subtitle {
    min-height: 0;
    margin: 0 !important;
}

.deco-smart-card-heading .deco-smart-price {
    align-self: start;
    min-width: max-content !important;
    max-width: 145px;
    margin: 0 !important;
    padding: 1px 0 0 8px;
    color: #f3212b !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    text-align: right;
}

.deco-smart-card-heading .deco-smart-price .amount,
.deco-smart-card-heading .deco-smart-price bdi,
.deco-smart-card-heading .deco-smart-price span,
.deco-smart-card-heading .deco-smart-price strong {
    color: #f3212b !important;
}

.deco-smart-card-heading .deco-smart-unit {
    display: block !important;
    margin-top: 1px;
    color: #f3212b !important;
    font-size: 0.62em !important;
    line-height: 1.05 !important;
    text-align: right;
}

.deco-smart-card-heading .deco-smart-price-line {
    margin-bottom: 2px;
}

@media (min-width: 761px) {
    .deco-smart-card {
        display: grid !important;
        grid-template-rows: 82px auto minmax(50px, auto) auto auto auto !important;
    }
}

@media (max-width: 760px) {
    .deco-smart-card-heading {
        gap: 8px;
    }

    .deco-smart-card-heading .deco-smart-price {
        max-width: 125px;
        font-size: 16px !important;
    }
}

/* v1.2.8 balanced media rows and alternative recommendations */
.deco-smart-card-media {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 145px;
    margin-bottom: 10px;
}

.deco-smart-card-media > img {
    width: 132px !important;
    height: 132px !important;
    object-fit: contain;
    align-self: center;
    justify-self: center;
}

.deco-smart-card-media .deco-smart-card-heading {
    display: flex;
    min-width: 0;
    height: 100%;
    margin: 0;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}

.deco-smart-card-media .deco-smart-price {
    align-self: flex-start;
    min-width: 0 !important;
    max-width: none;
    padding: 0;
    text-align: left;
}

.deco-smart-card-media .deco-smart-unit {
    text-align: left;
}

.deco-smart-rec-line {
    display: block !important;
    font-size: inherit !important;
    line-height: 1.25;
}

.deco-smart-rec-note {
    font-size: 0.88em !important;
}

.deco-smart-rec-line em {
    color: #555;
    font-size: 0.82em;
    font-style: normal;
    white-space: nowrap;
}

.deco-smart-recommendation {
    min-height: 74px !important;
    justify-content: center;
}

@media (min-width: 761px) {
    .deco-smart-card {
        display: flex !important;
        flex-direction: column;
    }

    .deco-smart-card-media {
        flex: 0 0 auto;
    }

    .deco-smart-recommendation {
        flex: 0 0 auto;
    }

    .deco-smart-primary {
        margin-top: auto !important;
    }
}

@media (max-width: 1050px) and (min-width: 761px) {
    .deco-smart-card-media {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        min-height: 116px;
    }

    .deco-smart-card-media > img {
        width: 104px !important;
        height: 104px !important;
    }
}

@media (max-width: 760px) {
    .deco-smart-card-media {
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 12px;
        min-height: 115px;
    }

    .deco-smart-card-media > img {
        width: 105px !important;
        height: 105px !important;
    }

    .deco-smart-recommendation {
        min-height: 0 !important;
    }
}


/* v1.2.9 recommendation guide and corrected Glue Devil conversion */
.deco-smart-guide {
    color: #f3212b;
    font-style: normal;
    font-weight: 700;
}

.deco-smart-rec-line em {
    white-space: nowrap;
}

/* Cart page: Clear Cart button */
.woocommerce-cart .deco-clear-cart-button,
.woocommerce-cart button.deco-clear-cart-button:disabled {
    opacity: 1 !important;
    cursor: pointer !important;
    background: #f3212b !important;
    border-color: #f3212b !important;
    color: #fff !important;
}

.woocommerce-cart .deco-clear-cart-button:hover,
.woocommerce-cart .deco-clear-cart-button:focus {
    background: #d91821 !important;
    border-color: #d91821 !important;
    color: #fff !important;
}

.woocommerce-cart .deco-clear-cart-button.is-loading {
    opacity: 0.65 !important;
    cursor: wait !important;
}


/* v1.3.4 Android/mobile modal opening position */
@media (max-width: 760px) {
    .deco-cart-success-backdrop {
        align-items: flex-start;
        overflow-y: auto;
        padding: 8px 0;
        overscroll-behavior: contain;
    }

    .deco-cart-success-dialog.deco-smart-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        margin: 0 auto;
        scroll-behavior: auto;
        overscroll-behavior: contain;
    }
}


/* Fallback styling for the mobile Shop submenu enhancement. */
@media (max-width: 1024px) {
    .deco-shop-menu-open > .deco-shop-submenu-open {
        display: block !important;
        max-height: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* v1.3.6 WPC wall-panel recommendation popup */
.deco-wpc-grid {
    grid-template-columns: minmax(280px, 430px);
    justify-content: center;
}

@media (min-width: 761px) {
    .deco-wpc-dialog {
        width: min(720px, 90vw) !important;
    }

    .deco-wpc-grid .deco-smart-card img {
        height: 120px;
    }
}

@media (max-width: 760px) {
    .deco-wpc-grid {
        grid-template-columns: 1fr;
    }
}


/* v1.3.8 Climate Board recommendation popup */
.deco-climate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.deco-climate-grid .deco-smart-card:last-child .deco-smart-recommendation {
    background: #eef3f6;
    border-color: #c7d2d9;
    color: #33434d;
}

@media (max-width: 900px) {
    .deco-climate-grid {
        grid-template-columns: 1fr;
    }
}
