/* Стили для иконки корзины */
.cart-icon {
    position: relative;
    color: #FFF;
    font-size: 30px;
    cursor: pointer;
    margin-left: 25rem;
    padding: 10px 20px;
    background: rgba(159, 127, 243, 0.8);
    border-radius: 10px;
    transition: opacity 0.3s;
}

.cart-icon:hover {
    opacity: 0.8;
}

header.fixed .cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    margin-left: 0;
    z-index: 1000;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4444;
    color: #FFF;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

/* Стили для модального окна корзины */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

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

.cart-content {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    color: #FFF;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.cart-content h2 {
    margin: 0 0 20px;
    font-size: 28px;
    text-transform: uppercase;
    text-align: center;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
}

.cart-item-title {
    flex: 1;
}

.cart-item-price {
    margin: 0 20px;
}

.remove-item {
    background: #ff4444;
    color: #FFF;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    font-size: 20px;
    font-weight: 900;
    background: rgba(159, 127, 243, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
}

.cart-total:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.checkout-btn,
.close-cart {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.3s;
}

.checkout-btn {
    background: #9F7FF3;
    color: #FFF;
}

.checkout-btn:hover,
.close-cart:hover {
    opacity: 0.8;
}

.close-cart {
    background: #FFF;
    color: #000;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .cart-icon {
        margin-right: 10px;
        padding: 10px;
        font-size: 24px;
        margin-left: 15rem;
    }

    header.fixed .cart-icon {
        font-size: 36px;
        padding: 15px;
        border-radius: 15px;
    }

    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .cart-modal.active {
        display: flex;
        align-items: flex-end;
    }

    .cart-content {
        width: 100%;
        max-width: none;
        padding: 15px;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
        overflow-y: auto;
    }

    .cart-content h2 {
        font-size: 20px;
    }

    .cart-items {
        max-height: 200px;
    }

    .cart-item {
        font-size: 14px;
        padding: 10px;
    }

    .remove-item {
        padding: 5px 10px;
        font-size: 12px;
    }

    .cart-total {
        font-size: 16px;
        padding: 10px 0;
    }

    .checkout-btn,
    .close-cart {
        padding: 12px;
        font-size: 16px;
    }
}

/* Стили для спиннера загрузки */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 33, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #9F7FF3;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Убираем text-shadow для iOS (Safari) */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Уточняем, что это для iOS */
    @supports (-webkit-touch-callout: none) {
        .headline-main,
        .headline-sub,
        .headline-main-second,
        .headline-sub-second,
        .headline-main-third {
            text-shadow: none !important;
        }
    }
}