/* ==========================================
   MODERN CART REDESIGN - Complete Rewrite
   ========================================== */

/* Circular close button - hidden by default, visible in cart popup */
.cart_pop_btn_close {
    position: fixed !important;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 0;
    padding: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    /* Hide text "Закрыть" */
    font-size: 0 !important;
    color: transparent !important;
    text-indent: -9999px;
    overflow: hidden;
}

/* When cart popup is visible (display:block), show the button */
.container--basket[style*="display: block"] .cart_pop_btn_close,
.container--basket[style*="display:block"] .cart_pop_btn_close,
.container--basket:not([style*="display: none"]):not([style*="display:none"]) .cart_pop_btn_close {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.cart_pop_btn_close:hover {
    transform: scale(1.1) rotate(90deg);
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.cart_pop_btn_close::before,
.cart_pop_btn_close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: #333;
}

.cart_pop_btn_close::before {
    transform: rotate(45deg);
}

.cart_pop_btn_close::after {
    transform: rotate(-45deg);
}

/* Cart container - Fix scrolling for tall content */
.container--basket {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%) !important;
    align-items: flex-start !important;
    /* Allow scrolling for tall content */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.basket {
    margin: 0px auto !important;
    /* Center horizontally and add top/bottom space */
    position: relative;
    /* max-width removed to respect original responsiveness */
}

.basket-container.basket-container--header {
    margin-bottom: 20px;
}

/* On mobile, reduce margins */
@media (max-width: 640px) {
    .basket {
        margin: 10px auto !important;
        width: 95% !important;
        padding: 5px !important;
    }
}

/* Cart header */
.basket__headline {
    color: #1a1a1a !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    margin-bottom: 0px !important;
    letter-spacing: -0.5px;
}

/* ==========================================
   CART ITEM CARD - Complete Redesign
   ========================================== */

.basket-products__group {
    border-radius: 16px;
    border: none;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.basket-products__group:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.basket-product {
    display: grid !important;
    grid-template-columns: 100px 1fr 40px !important;
    grid-template-rows: auto !important;
    gap: 16px !important;
    padding: 20px !important;
    position: relative;
    align-items: start !important;
}

/* Product Image - Column 1 */
.basket-product__info {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100px !important;
    margin: 0 !important;
}

.basket-product__info-img {
    width: 100px !important;
    min-width: 100px !important;
    height: 100px !important;
    border-radius: 12px !important;
    background: #f5f7f9 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden;
    border: 1px solid #eee;
}

.basket-product__info-picture {
    max-width: 90px !important;
    max-height: 90px !important;
    object-fit: contain !important;
}

/* Details Column - Column 2 (Name + Quantity + Price) */
.basket-product__details {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

/* Product Name */
.basket-product__name {
    display: block !important;
    color: #1a1a1a !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    margin: 0 !important;
    word-break: break-word;
}

.basket-product__name:hover {
    color: #FA5C21 !important;
}

/* Quantity Controls */
.basket-product__quantity {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    width: auto !important;
}

.form-quantity-container {
    display: flex;
    align-items: center;
}

.basket-product__quantity-form {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.form-quantity {
    display: flex !important;
    height: 40px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #f5f7f9 !important;
    border: 1px solid #e5e7eb !important;
}

.form-quantity__button {
    width: 40px !important;
    height: 40px !important;
    background: #f5f7f9 !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.form-quantity__button:hover {
    background: #FA5C21 !important;
    color: #fff !important;
}

.form-quantity__button:active {
    transform: scale(0.9) !important;
}

.form-quantity__input {
    width: 50px !important;
    height: 40px !important;
    border: none !important;
    background: #fff !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    padding: 0 !important;
}

.basket-product__quantity-label {
    font-size: 14px !important;
    color: #666 !important;
    margin: 0 !important;
}

.basket-product__quantity-label--small {
    font-weight: 500;
}

/* Price - inside details */
.basket-product__price {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
}

.basket-product__price::before {
    display: none !important;
}

.basket-product__price-main {
    color: #FA5C21 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    width: 100px;
}

.basket-product__price-old {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

/* Delete Button - Column 3 */
.basket-product__del {
    grid-column: 3 !important;
    grid-row: 1 !important;
    position: relative !important;
    width: 32px !important;
    height: 32px !important;
    background: #f5f5f5 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 0 auto;
}

.basket-product__del:hover {
    background: #fee2e2 !important;
    transform: rotate(90deg) scale(1.1) !important;
}

.basket-product__del--link {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 40% !important;
}

/* ==========================================
   PURCHASE SECTION
   ========================================== */

.basket-purchase {
    border-radius: 16px !important;
    padding: 24px !important;
    background: #fff !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    border: none !important;
    box-sizing: border-box;
}

.summation-block {
    margin-bottom: 0px;
}

.summation-block__results {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.summation-block__sum,
.basket-purchase__send-sum--new {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

.basket-purchase__buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 20px !important;
}

.custom-btn--blue {
    background: linear-gradient(135deg, #FA5C21 0%, #ff7043 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    height: 54px !important;
    width: 100% !important;
    box-shadow: 0 4px 16px rgba(250, 92, 33, 0.35) !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-btn--blue:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(250, 92, 33, 0.45) !important;
}

.custom-btn--white {
    border-radius: 12px !important;
    height: 48px !important;
    border: 2px solid #e5e7eb !important;
    background: #fff !important;
    transition: all 0.3s ease !important;
}

.custom-btn--white:hover {
    background: #f5f7f9 !important;
    border-color: #d0d0d0 !important;
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */

@media (max-width: 640px) {
    .basket-product {
        grid-template-columns: 80px 1fr !important;
        grid-template-rows: auto auto auto !important;
        padding: 16px !important;
        row-gap: 0px !important;
        column-gap: 12px !important;
    }

    .basket-product__info {
        width: 80px !important;
        grid-row: 1 / 2 !important;
    }

    .basket-product__info-img {
        width: 80px !important;
        min-width: 80px !important;
        height: 80px !important;
    }

    .basket-product__info-picture {
        max-width: 70px !important;
        max-height: 70px !important;
    }

    .basket-product__info-name {
        grid-column: 2 !important;
        grid-row: 1 !important;
        font-size: 13px !important;
        padding-right: 35px !important;
    }

    .basket-product__quantity {
        grid-column: 1 / 3 !important;
        grid-row: 2 !important;
        justify-content: flex-start !important;
    }

    .basket-product__price {
        grid-column: 1 / 3 !important;
        grid-row: 3 !important;
        align-items: flex-start !important;
        padding-top: 8px !important;
        border-top: 1px solid #f0f0f0 !important;
    }

    .basket-product__price-main {
        font-size: 20px !important;
    }

    .basket-product__del {
        width: 28px !important;
        height: 28px !important;
        top: 12px !important;
        right: 12px !important;
    }

    .basket__headline {
        font-size: 20px !important;
    }

    .cart_pop_btn_close {
        width: 40px;
        height: 40px;
        top: 15px;
        right: 15px;
    }

    .basket-purchase {
        padding: 0px 20px !important;
        border-radius: 12px !important;
    }

    .summation-block__sum,
    .basket-purchase__send-sum--new {
        font-size: 24px !important;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.basket-products__group {
    animation: fadeInUp 0.4s ease forwards;
}
/* ==========================================
   MINIMUM ORDER WARNING
   ========================================== */

.min-order-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFF8E1 100%);
    border: 1px solid #FFE0B2;
    border-radius: 12px;
    margin-bottom: 12px;
}

.min-order-warning__icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.min-order-warning__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.min-order-warning__title {
    font-size: 14px;
    font-weight: 600;
    color: #E65100;
}

.min-order-warning__left {
    font-size: 13px;
    color: #BF360C;
    font-weight: 500;
}

/* Disabled checkout button */
.purchase-btn--disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.purchase-btn--disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}
