/* ========================================
   Cart Popup — Modern Design
   ======================================== */

#cartpopup {
    display: none;
    max-width: 100%;
    box-sizing: border-box;
}

#cartpopup *,
#cartpopup *::before,
#cartpopup *::after {
    box-sizing: border-box;
}

/* Popup card */
#cartpopup.well,
#cartpopup .well {
    background-color: #FFF;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 28px 28px 24px;
    margin-bottom: 20px;
    min-height: 20px;
    width: 520px;
}

/* Header with checkmark */
.cartpopup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EEF2F7;
}

.cartpopup-header__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.cartpopup-header__text {
    font-size: 18px;
    font-weight: 600;
    color: #141414;
    line-height: 1.3;
}

/* Cart items area */
#cartpopup .cart {
    padding: 0;
}

#cartpopup .mini-cart-info {
    margin-bottom: 20px;
    max-height: 280px;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

#cartpopup .mini-cart-info::-webkit-scrollbar {
    width: 4px;
}

#cartpopup .mini-cart-info::-webkit-scrollbar-track {
    background: transparent;
}

#cartpopup .mini-cart-info::-webkit-scrollbar-thumb {
    background-color: #D1D5DB;
    border-radius: 4px;
}

/* Product rows */
#cartpopup .header-cartbox__row {
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

#cartpopup .header-cartbox__row:last-child {
    border-bottom: none;
}

#cartpopup .header-cartbox__image {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 8px;
    background: #F9FAFB;
    padding: 4px;
}

#cartpopup .header-cartbox__name {
    font-size: 14px;
    color: #141414;
    text-decoration: none;
    line-height: 1.4;
    font-weight: 400;
}

#cartpopup .header-cartbox__name:hover {
    color: #007AFF;
}

#cartpopup .header-cartbox__quantity {
    font-size: 14px;
    color: #6B7280;
    font-weight: 400;
}

#cartpopup .header-cartbox__price {
    font-size: 15px;
    color: #141414;
    font-weight: 600;
    white-space: nowrap;
}

#cartpopup .header-cartbox__remove {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-40%);
    opacity: 0.4;
    transition: opacity 0.15s;
}

#cartpopup .header-cartbox__row:hover .header-cartbox__remove {
    opacity: 0.7;
}

#cartpopup .header-cartbox__remove svg {
    width: 24px;
    height: 24px;
    cursor: pointer;
    fill: #6B7280;
}

#cartpopup .header-cartbox__remove svg:hover {
    fill: #141414;
}

#cartpopup .header-cartbox__row {
    position: relative;
    padding-right: 36px;
}

/* Buttons area */
.cartpopup-buttons {
    display: flex;
    gap: 12px;
    padding-top: 4px;
}

.cartpopup-btn {
    flex: 1;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    cursor: pointer;
    text-transform: none !important;
    letter-spacing: 0;
    transition: all 0.15s ease;
    line-height: 1.4 !important;
    -webkit-appearance: none;
}

.cartpopup-btn--primary {
    background-color: #007AFF !important;
    color: #FFF !important;
    border: 2px solid #007AFF !important;
}

.cartpopup-btn--primary:hover {
    background-color: #0066DB !important;
    border-color: #0066DB !important;
}

#cartpopup .cartpopup-btn--outline,
#cartpopup .cartpopup-btn--outline.button {
    background-color: #FFF !important;
    color: #141414 !important;
    border: 2px solid #D1D5DB !important;
    -webkit-text-fill-color: #141414;
}

#cartpopup .cartpopup-btn--outline:hover,
#cartpopup .cartpopup-btn--outline.button:hover {
    background-color: #F9FAFB !important;
    border-color: #9CA3AF !important;
    color: #141414 !important;
    -webkit-text-fill-color: #141414;
}

/* Links inside popup */
#cartpopup a {
    color: #141414;
    text-decoration: none;
}

/* Legacy compat */
#cartpopup .icon_success_27x27 {
    display: none;
}

#cartpopup .mini-cart-info td {
    padding: 3px 5px;
}

/* ========================================
   Mobile
   ======================================== */
@media (max-width: 767px) {
    #cartpopup.well,
    #cartpopup .well {
        width: calc(100% - 32px) !important;
        padding: 20px 16px !important;
        border-radius: 14px;
    }

    .cartpopup-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .cartpopup-header__text {
        font-size: 16px;
    }

    .cartpopup-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .cartpopup-btn {
        width: 100%;
    }

    #cartpopup .mini-cart-info {
        max-height: 220px;
    }

    #cartpopup .header-cartbox__image {
        width: 44px;
        height: 44px;
    }
}