/* Стилі для кнопки корзини */
#cart {
    position: relative;
}

/* Keep "1 170 грн." on a single line inside the narrow header cart button.
   Both the thousand separator and the currency prefix are NBSP, and the
   containing spans are nowrap so neither the browser nor a stray whitespace
   character between nested spans can break the number across two lines. */
#cart-total,
#cart-total .cart-totals {
    white-space: nowrap;
}

#cart .btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}


   #cart{
background: #0271e3;
color: white;
min-width: 75px;
border-radius: 10px;
font-size: 12px;
font-weight: 500;
padding: 4px 7px;
    }

#cart .btn:hover {
    background: inherit;
}

#cart .btn i {
    font-size: 18px;
}

/* Модальне вікно на всю сторінку */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.cart-modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cart-modal-content {
    background: #fff;
    min-height: 100vh;
    padding: 40px 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cart-modal-container {
    max-width: 1600px;
    margin: 0 auto;
    background-color: white;
}

/* Заголовок */
.cart-modal-header {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.cart-modal-header .item-count {
    color: #666;
    font-size: 16px;
    margin-top: 5px;
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    padding: 4px;
    line-height: 1;
}

.cart-close-btn:hover {
    color: #000;
}

/* Контент */
.cart-modal-body {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 30px;
}

.cart-items {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;

}

.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    padding: 25px;
    align-items: center;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}



.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    height: 80px;
    width: auto;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.item-image img {
    height: 80px;
    width: auto;
    display: block;
    object-fit: contain;
}

.item-image a {
    display: block;
    height: 100%;
}

.item-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-decoration: none;
    display: inline-block;
}

.item-name:hover {

}

.item-options {
    margin-top: 8px;
}

.item-option {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.item-recurring {
    font-size: 14px;
    color: #28a745;
    margin-top: 4px;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-label {
    font-size: 14px;
    color: #666;
}

.quantity-value {
    font-weight: 600;
    color: #333;
}

.item-right {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    min-width: 200px;
}

.item-price {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.item-remove {
background: transparent;
color: black;
border: none;
cursor: pointer;
}

.item-remove:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: none;
}

/* Підсумок */
.cart-summary {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: none;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.summary-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.summary-table {
    width: 100%;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
    border-bottom: none;
    padding-top: 15px;
    margin-top: 5px;
    border-top: 2px solid #333;
}

.summary-label {
    font-size: 15px;
    color: #666;
}

.summary-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.summary-row:last-child .summary-label,
.summary-row:last-child .summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-checkout {
    background: #111;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-checkout:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: none;
    color: white;
}

.btn-view-cart {
    background: #007bff;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view-cart:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: none;
    color: white;
}

/* Порожня корзина */
.empty-cart {
    background: #fff;
    border-radius: 12px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: none;
    grid-column: 1 / -1;
}

.empty-cart i {
    display: none;
}

.empty-cart h3 {
    font-size: 24px;
    color: #666;
    margin-bottom: 10px;
}

.empty-cart p {
    font-size: 16px;
    color: #999;
}

/* Ваучери */
.voucher-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.voucher-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ffc107;
    background: #fff;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 992px) {
    .cart-modal-body {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-modal-content {
        padding: 20px 15px;
    }

    .cart-modal-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding: 20px;
    }

    .cart-modal-header h2 {
        font-size: 24px;
    }

    .cart-close-btn {
        width: 100%;
        justify-content: center;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
        padding: 15px;
    }

    .item-image {
        width: 80px;
        height: 80px;
    }

    .item-right {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
    }

    .item-price {
        font-size: 18px;
    }

    .item-name {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .cart-modal-header h2 {
        font-size: 20px;
    }

    .summary-title {
        font-size: 18px;
    }
}


    #cart a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
    #cart a:hover{
        color: inherit;
        cursor: pointer;
    }

#cart a span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    line-height: 1;
}

#cart a svg {
width: 16px;
height: 16px;
display: block;
}
