/* Cart modal — conversion layout */
.cart-modal .modal-dialog{
    max-width:560px;
    width:calc(100% - 24px);
    margin:24px auto;
}
.cart-modal .modal-content.cart-modal__content{
    border:none;
    border-radius:18px;
    box-shadow:0 28px 64px rgba(15, 23, 42, .22);
    overflow:hidden;
    display:flex;
    flex-direction:column;
    max-height:calc(100dvh - 16px);
}
.cart-modal .modal-header.cart-modal__header{
    display:block;
    position:relative;
    padding:18px 52px 16px 20px;
    border-bottom:1px solid rgba(22, 34, 51, .07);
    background:#fff;
    text-align:left;
}
.cart-modal .modal-header .close.cart-modal__close{
    position:absolute;
    top:12px;
    right:12px;
    z-index:3;
    width:36px;
    height:36px;
    margin:0;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    font-weight:300;
    line-height:1;
    color:#64748b;
    background:transparent;
    border:none;
    border-radius:50%;
    opacity:1;
    transition:background .15s ease, color .15s ease;
}
.cart-modal .modal-header .close.cart-modal__close:hover,
.cart-modal .modal-header .close.cart-modal__close:focus{
    background:rgba(22, 34, 51, .06);
    color:#182233;
    opacity:1;
}
.cart-modal__title-wrap{
    display:flex;
    align-items:center;
    gap:10px;
}
.cart-modal__title-icon{
    flex:0 0 auto;
    font-size:1.1em;
    color:#2d6a4f;
}
.cart-modal .modal-title.cart-modal__title{
    margin:0;
    padding:0;
    font-size:1.15em;
    font-weight:800;
    color:#0f172a;
}
.cart-modal__body{
    flex:1 1 auto;
    min-height:0;
    padding:0;
    max-height:none;
    overflow-x:hidden;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
}
.cart-modal__footer{
    flex:0 0 auto;
    border-top:1px solid rgba(22, 34, 51, .08);
    background:#fff;
    box-shadow:0 -10px 28px rgba(15, 23, 42, .1);
}
.cart-modal__footer .cart-popup__footer{
    padding:14px 20px max(16px, env(safe-area-inset-bottom));
    border-top:none;
    background:transparent;
    box-shadow:none;
}

/* Popup content */
.cart-popup{
    padding:16px 20px 20px;
}
.cart-popup__success{
    display:none;
    align-items:center;
    gap:8px;
    margin:0 0 14px;
    padding:10px 14px;
    font-size:.88em;
    font-weight:700;
    color:#2d6a4f;
    border-radius:12px;
    background:linear-gradient(90deg, #f0f7f3 0%, #eef6fb 100%);
}
.cart-popup--added .cart-popup__success{
    display:flex;
}
.cart-popup__success .fa{
    font-size:1.15em;
}

.cart-popup__benefit{
    margin:0 0 14px;
    padding:12px 14px;
    border-radius:14px;
    background:linear-gradient(135deg, #fff5f5 0%, #fff8f0 55%, #f0f7f3 100%);
    border:1px solid rgba(192, 57, 43, .18);
    box-shadow:0 4px 16px rgba(192, 57, 43, .08);
}
.cart-popup__benefit-head{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0 0 10px;
    font-size:.88em;
    font-weight:800;
    color:#c0392b;
}
.cart-popup__benefit-head .fa{
    font-size:1.05em;
}
.cart-popup__benefit-items{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}
.cart-popup__benefit-chip{
    display:inline-flex;
    align-items:center;
    padding:5px 10px;
    font-size:.74em;
    font-weight:800;
    line-height:1.2;
    border-radius:999px;
    white-space:nowrap;
}
.cart-popup__benefit-chip--sale{
    color:#fff;
    background:linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}
.cart-popup__benefit-chip--gift{
    color:#7c4a03;
    background:#fff3d6;
    border:1px solid rgba(245, 166, 35, .35);
}
.cart-popup__benefit-chip--delivery{
    color:#2d6a4f;
    background:rgba(45, 106, 79, .1);
    border:1px solid rgba(45, 106, 79, .18);
}

.cart-popup__items.header-cart__wrapper{
    display:flex;
    flex-direction:column;
    gap:0;
    max-height:38vh;
    margin:0 0 14px;
    padding:0;
    border:none;
    overflow-y:auto;
    scrollbar-width:thin;
}
.cart-popup__item.header-cart__item{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:12px 0;
    border:none;
    border-top:1px solid rgba(22, 34, 51, .08);
}
.cart-popup__item.header-cart__item:first-child{
    padding-top:0;
    border-top:none;
}
.cart-popup__image{
    flex:0 0 72px;
    width:72px;
    padding:0;
}
.cart-popup__img{
    width:72px;
    height:72px;
    padding:6px;
    object-fit:contain;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid rgba(22, 34, 51, .06);
}
.cart-popup__body{
    flex:1 1 auto;
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.cart-popup__name{
    flex:1 1 auto;
    min-width:0;
    padding:0;
    font-size:.88em;
    font-weight:700;
    line-height:1.35;
}
.cart-popup__name a{
    color:#0f172a;
}
.cart-popup__item-save{
    margin-top:4px;
    font-size:.72em;
    font-weight:700;
    color:#c0392b;
}
.cart-popup__meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
}
.cart-popup__price{
    text-align:right;
}
.cart-popup__price-label{
    display:block;
    margin:0 0 2px;
    font-size:.65em;
    font-weight:600;
    color:#94a3b8;
    text-transform:uppercase;
    letter-spacing:.03em;
}
.cart-popup__price-unit{
    margin:0 0 4px;
    font-size:.78em;
    color:#64748b;
}
.cart-popup__price-was{
    margin-right:6px;
    text-decoration:line-through;
    color:#182233;
}
.cart-popup__price-total-wrap{
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    justify-content:flex-end;
    gap:6px;
}
.cart-popup__price-old{
    font-size:.82em;
    font-weight:600;
    text-decoration:line-through;
    color:#182233;
}
.cart-popup__price-total{
    font-size:1.05em;
    font-weight:800;
    color:var(--price-new-c, #c0392b);
    white-space:nowrap;
}
.cart-popup__remove{
    flex:0 0 auto;
    padding-top:4px;
}
.cart-popup__remove .header-cart__remove-btn{
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#94a3b8;
    border-radius:8px;
    transition:color .15s, background .15s;
}
.cart-popup__remove .header-cart__remove-btn:hover{
    color:#c0392b;
    background:rgba(192, 57, 43, .08);
}

.cart-popup__gifts{
    margin:0 0 14px;
    padding:12px 12px 10px;
    border-radius:14px;
    background:linear-gradient(135deg, #fffdf8 0%, #fff5f5 100%);
    border:1px solid rgba(245, 166, 35, .22);
    overflow:visible;
}
.cart-popup__gifts-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin:0 0 10px;
}
.cart-popup__gifts-title{
    margin:0;
    font-size:.84em;
    font-weight:800;
    color:#0f172a;
}
.cart-popup__gifts-count{
    flex:0 0 auto;
    min-width:22px;
    padding:2px 8px;
    font-size:.72em;
    font-weight:800;
    text-align:center;
    color:#7c4a03;
    border-radius:999px;
    background:#fff3d6;
}
.cart-popup__gifts-grid{
    display:flex;
    flex-wrap:nowrap;
    gap:10px;
    overflow-x:auto;
    overflow-y:visible;
    padding:8px 4px 4px;
    scrollbar-width:thin;
}
.cart-popup__gift-card{
    flex:0 0 84px;
    width:84px;
    text-align:center;
    overflow:visible;
}
.cart-popup__gift-media{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    width:84px;
    height:72px;
    margin:0 0 6px;
    padding:8px;
    border-radius:12px;
    background:#fff;
    border:1px solid rgba(22, 34, 51, .08);
    box-shadow:0 3px 10px rgba(15, 23, 42, .06);
    overflow:visible;
}
.cart-popup__gift-img{
    width:100%;
    height:100%;
    max-width:64px;
    max-height:56px;
    object-fit:contain;
}
.cart-popup__gift-placeholder{
    display:flex;
    align-items:center;
    justify-content:center;
    width:52px;
    height:52px;
    font-size:1.4em;
    color:#2d6a4f;
    opacity:.45;
}
.cart-popup__gift-qty{
    position:absolute;
    top:0;
    right:0;
    z-index:2;
    min-width:18px;
    padding:2px 6px;
    font-size:.65em;
    font-weight:800;
    line-height:1.3;
    color:#fff;
    border-radius:999px;
    background:#2d6a4f;
    box-shadow:0 2px 6px rgba(45, 106, 79, .35);
    transform:translate(35%, -35%);
}
.cart-popup__gift-name{
    display:-webkit-box;
    overflow:hidden;
    font-size:.68em;
    font-weight:600;
    line-height:1.3;
    color:#4f5d6f;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

.cart-popup__perks{
    display:none;
}

.cart-popup__footer{
    padding-top:14px;
    border-top:1px dashed rgba(22, 34, 51, .12);
    background:linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 24%);
}
.cart-modal__footer .cart-popup__footer{
    padding-top:0;
    border-top:none;
    background:transparent;
}
.cart-popup__footer-save{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin:0 0 10px;
    padding:8px 12px;
    font-size:.78em;
    font-weight:600;
    color:#64748b;
    border-radius:10px;
    background:#fff5f5;
}
.cart-popup__footer-save strong{
    font-size:1.05em;
    font-weight:800;
    color:#c0392b;
}
.cart-popup__total-row{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    margin:0 0 6px;
    font-size:1.25em;
    font-weight:800;
}
.cart-popup__total-value{
    color:var(--price-new-c, #c0392b);
}
.cart-popup__hint{
    display:none;
}
.cart-popup__actions{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin:0;
}
.cart-popup__btn{
    width:100%;
    min-height:48px;
    margin:0;
    font-weight:700;
    border-radius:12px;
}
.cart-popup__btn--primary{
    order:-1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    min-height:56px;
    padding:10px 16px;
    font-size:1em;
    background:linear-gradient(180deg, #357a5c 0%, #2d6a4f 100%);
    border-color:#245a42;
    box-shadow:0 8px 22px rgba(45, 106, 79, .28);
}
.cart-popup__btn-main{
    font-size:1.02em;
    font-weight:800;
    line-height:1.2;
}
.cart-popup__btn-sub{
    font-size:.68em;
    font-weight:600;
    line-height:1.2;
    opacity:.88;
}
.cart-popup__btn--primary:hover,
.cart-popup__btn--primary:focus{
    background:linear-gradient(180deg, #2d6a4f 0%, #245a42 100%);
    color:#fff;
}
.cart-popup__btn--ghost{
    font-size:.88em;
    color:#64748b;
    background:transparent;
    border:1px dashed rgba(22, 34, 51, .16);
}

.cart-popup__empty{
    padding:24px 16px 32px;
    text-align:center;
}
.cart-popup__empty-icon{
    width:88px;
    height:88px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 14px;
    font-size:2.2em;
    color:#2d6a4f;
    border-radius:50%;
    background:linear-gradient(135deg, #f0f7f3 0%, #eef6fb 100%);
}
.cart-popup__empty-title{
    margin:0 0 8px;
    font-size:1.05em;
    font-weight:800;
    color:#0f172a;
}
.cart-popup__empty-hint{
    margin:0;
    font-size:.85em;
    line-height:1.45;
    color:#64748b;
}

.cart-popup__quantity .qty-switch__input{
    height:32px;
    border-radius:8px;
    border-color:rgba(22, 34, 51, .12);
}
.cart-popup__quantity .qty-switch__btn{
    width:28px;
    height:32px;
    line-height:31px;
    border-radius:8px;
    background:#f4f6f8;
}

@media (max-width:575px){
    .cart-modal .modal-dialog{
        width:calc(100% - 16px);
        margin:8px auto;
    }
    .cart-modal .modal-content.cart-modal__content{
        max-height:calc(100dvh - 12px);
        border-radius:16px;
    }
    .cart-popup{
        padding:14px 16px 12px;
    }
    .cart-modal__footer .cart-popup__footer{
        padding:12px 16px max(14px, env(safe-area-inset-bottom));
    }
    .cart-popup__meta{
        flex-direction:column;
        align-items:flex-start;
    }
    .cart-popup__price{
        text-align:left;
    }
    .cart-popup--added .cart-popup__items.header-cart__wrapper{
        max-height:min(28vh, 200px);
    }
    .cart-popup--added .cart-popup__gifts{
        margin-bottom:10px;
        padding:10px;
    }
    .cart-popup--added .cart-popup__benefit{
        margin-bottom:10px;
        padding:10px 12px;
    }
    .cart-popup__btn--primary{
        min-height:52px;
    }
}

@media (max-height:640px){
    .cart-popup--added .cart-popup__items.header-cart__wrapper{
        max-height:min(24vh, 160px);
    }
    .cart-popup--added .cart-popup__success{
        margin-bottom:10px;
        padding:8px 12px;
    }
}
