/* Стилі для кошика та модальних вікон */

/* Кнопка кошика */
.cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 999;
    border: none;
    color: white;
    font-size: 24px;
}

.cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cart-button:active {
    transform: scale(0.95);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Модальне вікно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

/* Товари в кошику */
.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cart-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

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

.cart-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.cart-item-variant {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
}

.cart-item-price {
    font-weight: 600;
    color: #667eea;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 4px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #667eea;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #667eea;
    color: white;
}

.quantity-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
}

.remove-btn:hover {
    transform: scale(1.2);
}

/* Підсумок */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.cart-total-label {
    font-weight: 600;
    color: #333;
}

.cart-total-price {
    font-weight: bold;
    color: #667eea;
    font-size: 1.3em;
}

/* Кнопки */
.btn-checkout {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Сповіщення */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
}

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

/* Форма замовлення */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-group small {
    color: #666;
    font-size: 0.85em;
}

/* Адаптив */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .cart-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}

/* ============== МОДАЛЬНЕ ВІКНО ДЕТАЛЕЙ ТОВАРУ ============== */

.product-details-content {
    max-width: 600px;
}

/* Галерея фото */
.product-details-gallery {
    margin-bottom: 20px;
}

.main-image {
    width: 100%;
    height: 350px;
    background: #ffffff00;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnail:hover {
    transform: scale(1.05);
    border-color: #667eea;
}

.thumbnail.active {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

/* Опис товару */
.product-details-description {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.product-details-description h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.product-details-description p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Варіанти товару */
.product-details-variants {
    margin-bottom: 15px;
}

.product-details-variants h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.variants-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.variant-info {
    flex: 1;
}

.variant-size {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.variant-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-new {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.variant-add-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: white;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-add-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

/* Адаптив для деталей товару */
@media (max-width: 480px) {
    .main-image {
        height: 250px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .product-details-content {
        max-width: 95%;
    }
}
