/**
 * Стили корзины товаров для сайта Мир Стейков
 */

/* Кнопка корзины */
.cart-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(315deg, #006400 0%, #32CD32 100%);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 100, 0, 0.3);
}

.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 100, 0, 0.4);
}

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

.cart-count {
    background: #dc3545;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Модальное окно корзины */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.cart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cart-modal-header {
    background: linear-gradient(315deg, #006400 0%, #32CD32 100%);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-modal-header h3 {
    margin: 0;
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 20px;
}

.cart-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.cart-modal-close:hover {
    transform: scale(1.1);
}

.cart-modal-body {
    padding: 25px;
    max-height: 50vh;
    overflow-y: auto;
}

.cart-modal-body::-webkit-scrollbar {
    width: 6px;
}

.cart-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cart-modal-body::-webkit-scrollbar-thumb {
    background: #32CD32;
    border-radius: 3px;
}

/* Товары в корзине */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.cart-item:hover {
    background: #e9ecef;
}

.cart-item-name {
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(315deg, #006400 0%, #32CD32 100%);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cart-qty-btn:hover {
    opacity: 0.9;
}

.cart-qty-input {
    width: 50px;
    height: 28px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
}

.cart-qty-input:focus {
    outline: none;
    border-color: #32CD32;
}

.cart-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #dc3545;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cart-remove-btn:hover {
    background: #c82333;
}

.cart-item-total {
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 16px;
    color: #32CD32;
    text-align: right;
    margin-top: 5px;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

/* Итого */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-bottom: 20px;
}

.cart-total-label {
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 16px;
    color: #333;
}

.cart-total-amount {
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 22px;
    color: #32CD32;
}

/* Форма заказа */
.cart-form-wrapper {
    margin-top: 20px;
}

.cart-order-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-form-group label {
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 13px;
    color: #333;
}

.cart-form-group input,
.cart-form-group textarea {
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.cart-form-group input:focus,
.cart-form-group textarea:focus {
    outline: none;
    border-color: #32CD32;
}

.cart-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.cart-submit-btn {
    background: linear-gradient(315deg, #006400 0%, #32CD32 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 100, 0, 0.3);
}

.cart-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 100, 0, 0.4);
}

.cart-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Уведомление */
.cart-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #32CD32;
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-family: 'Gilroy SemiBold', sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
    z-index: 10001;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.cart-notification-show {
    transform: translateX(0);
}

/* Адаптивность */
@media (max-width: 768px) {
    .cart-btn {
        top: auto;
        bottom: 20px;
        right: 20px;
        padding: 14px 18px;
    }

    .cart-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .cart-modal-header {
        padding: 15px 20px;
    }

    .cart-modal-body {
        padding: 15px;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cart-item-controls {
        justify-content: space-between;
    }

    .cart-item-total {
        text-align: left;
    }
}
