/* ===== PREMIUM POPUP MODAL (ISOLATED STYLES) ===== */
.premium-popup-wrapper * {
    font-family: 'Montserrat', sans-serif !important;
    box-sizing: border-box;
}

#popupModal .modal-dialog {
    width: 500px !important;
    max-width: 95vw !important;
    margin: 10vh auto !important;
    border: none !important;
}

#popupModal .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.premium-popup-container {
    position: relative;
    width: 100%;
    background: #ffffff !important;
    border-radius: 35px !important;
    padding: 40px !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15) !important;
}

.premium-popup-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 25px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.premium-popup-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.premium-popup-close {
    width: 36px !important;
    height: 36px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
}

.premium-popup-close:hover {
    opacity: 0.7 !important;
    transform: rotate(90deg) !important;
}

.premium-popup-close svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.premium-popup-body {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}

/* Стили для кнопок в футере модалки */
.premium-popup-footer {
    display: flex !important;
    gap: 15px !important;
    margin-top: 10px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.premium-popup-btn-back {
    background: none !important;
    border: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #2D4E6A !important;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    text-align: center !important;
    line-height: 140% !important;
    display: block !important;
    width: 100% !important;
    padding: 10px !important;
}

.premium-popup-btn-back:hover {
    opacity: 0.8 !important;
}

/* Если в попапе есть кнопки shopping */
.btn-shopping {
    display: none !important; /* Убираем лишнее, если не нужно */
}

@media (max-width: 576px) {
    .premium-popup-container { padding: 30px 20px !important; }
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

body.modal-open,
.modal-open #popupModal,
#popupModal {
    padding-right: 0 !important;
    overflow-y: auto !important;
}

#popupModal .premium-popup-header { display: none !important; }
#popupModal .modal-footer { display: none !important; }

#popupModal .modal-dialog {
    width: 520px !important;
    max-width: 95vw !important;
    margin: 40px auto !important;
}
#popupModal .modal-content {
    border-radius: 35px !important;
    border: none !important;
    box-shadow: 0 40px 120px rgba(0,0,0,0.2) !important;
    overflow: hidden;
    width: 520px !important;
    padding: 0 !important;
}
#popupModal .modal-body { padding: 0 !important; }
#popupModal .premium-popup-container { padding: 0 !important; margin: 0 !important; }

.premium-cart-wrap {
    font-family: 'Montserrat', sans-serif !important;
    background: #fff;
    color: <?php echo $text_dark; ?>;
    width: 100% !important;
    position: relative;
    padding: 30px 40px !important;
}

.cart-header {
    padding: 0 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 10px !important;
    border-bottom: 1px solid #f1f5f9;
}
.cart-header-title { font-size: 20px; font-weight: 700; color: <?php echo $text_dark; ?>; margin: 0 !important; }

.cart-close-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 !important;
    width: 44px;
    height: 44px;
}
.cart-close-btn svg { width: 100%; height: 100%; transition: transform 0.3s ease; }
.cart-close-btn:hover svg { transform: rotate(90deg); }

.cart-body-scroll {
    max-height: 225px;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s;
}
.cart-body-scroll:hover { scrollbar-color: #e2e8f0 transparent; }
.cart-body-scroll::-webkit-scrollbar { width: 4px; }
.cart-body-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 10px; transition: background 0.3s; }
.cart-body-scroll:hover::-webkit-scrollbar-thumb { background: #e2e8f0; }

.cart-item {
    display: flex; align-items: center;
    padding: 10px 6px;
    border-bottom: none !important; gap: 15px;
}

.cart-item-img {
    width: 90px; height: 90px; flex-shrink: 0;
    border-radius: 22px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 2px solid #fff;
    background: #f8fafc;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cart-item-name {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600;
    font-size: 15px;
    line-height: 140%;
    color: #000000;
    text-decoration: none;
    white-space: normal;
}

.cart-item-meta { display: flex; align-items: center; gap: 12px; }
.cart-qty-badge {
    background: <?php echo $color_blue_bg; ?>;
    color: <?php echo $color_blue_text; ?>;
    padding: 5px 12px;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600;
    font-size: 12px;
    line-height: 140%;
}
.cart-item-price {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600;
    font-size: 16px;
    line-height: 140%;
    color: <?php echo $color_price; ?>;
    text-align: right;
}

.cart-remove-btn {
    margin-left: auto; color: #ef4444 !important; font-size: 22px;
    background: none; border: none; padding: 5px; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; opacity: 0.9;
}
.cart-remove-btn:hover { transform: scale(1.1); opacity: 1; color: #dc2626 !important; }
.btn-loading { animation: spin 1s linear infinite; color: <?php echo $accent_orange; ?> !important; display: inline-block !important; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.cart-footer { padding: 0; background: #fff; margin: 15px 0 0 !important; }
.cart-totals-list { margin-bottom: 15px; border-top: 1px solid #f1f5f9; padding-top: 15px; }

.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cart-total-row span { font-family: 'Montserrat', sans-serif !important; font-weight: 500; font-size: 13px; line-height: 140%; color: <?php echo $color_total_label; ?>; }
.cart-total-row b { font-family: 'Montserrat', sans-serif !important; font-weight: 600; font-size: 13px; line-height: 140%; color: <?php echo $color_price; ?>; text-align: right; }

.cart-total-grand { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 15px; border-top: 1px solid #f1f5f9; }
.cart-total-grand span { font-family: 'Montserrat', sans-serif !important; font-weight: 600; font-size: 18px; color: <?php echo $text_dark; ?>; }
.cart-total-grand .amount { font-family: 'Montserrat', sans-serif !important; font-weight: 600; font-size: 24px; line-height: 140%; color: <?php echo $color_price; ?>; text-align: right; }

.btn-checkout-premium {
    background: linear-gradient(135deg, <?php echo $accent_orange; ?>, #f59e0b);
    color: #fff !important;
    width: 308px;
    height: 55px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 55px; font-size: 16px; font-weight: 700; border: none;
    box-shadow: 0 8px 20px rgba(230, 140, 51, 0.2); transition: all 0.3s ease;
    text-decoration: none !important;
    margin: 20px auto 0;
    gap: 12px;
    position: relative;
}
.btn-checkout-premium:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(230, 140, 51, 0.3); }
.btn-checkout-premium.is-processing {
    opacity: 0.7 !important;
    pointer-events: none !important;
    cursor: default !important;
}

.btn-loading {
    animation: btnRotation 1s linear infinite;
    display: inline-block;
}

@keyframes btnRotation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-continue-shopping { display: block; text-align: center; margin-top: 12px; color: #94a3b8; font-weight: 600; font-size: 13px; text-decoration: none !important; }

#cart .dropdown-menu {
    padding: 0 !important;
    border: none !important;
    background: #fff !important;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.2) !important;
    width: 440px !important;
    border-radius: 28px !important;
    margin-top: 15px !important;
    right: 0 !important;
    left: auto !important;
    overflow: hidden;
}

.nh-cart-icon-wrap {
    position: relative;
    display: inline-flex;
}

.nh-cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    background: #e68c33;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    animation: cartBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

@keyframes cartBadgePop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 576px) {
    #popupModal .modal-dialog {
        width: calc(100% - 20px) !important;
        margin: auto !important;
        display: flex !important;
        align-items: center !important;
        min-height: calc(100vh - 20px) !important;
    }
    #popupModal .modal-content { width: 100% !important; border-radius: 25px !important; }
    .premium-cart-wrap { padding: 20px !important; }
    .cart-header { padding-bottom: 10px; }
    .cart-header-title { font-size: 18px; }
    .cart-body-scroll { max-height: 170px; }
    .cart-item { padding: 5px 0; }
    .cart-item-img { width: 75px; height: 75px; border-radius: 16px; }
    .cart-item-name { font-size: 14px; }
    .cart-item-price { font-size: 14px; }
    .cart-remove-btn { font-size: 20px; padding: 10px; }
    .cart-total-grand .amount { font-size: 20px; }
    .btn-checkout-premium { width: 100% !important; height: 55px; font-size: 15px; }

    #cart .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        margin: 0 !important;
        border-radius: 20px !important;
    }
}
body.modal-open,
body.common-home.modal-open,
body.owl-moneymaker2-fullscreen.modal-open,
.owl-moneymaker2-fullscreen {
    padding-right: 0 !important;
}
