/**
 * Стили для товарных карточек голосового заказа
 * Файл: design/template2022/css/voice-product-card.css
 */

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

   .voice-product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.voice-product-modal.active {
    opacity: 1;
    visibility: visible;
}

.voice-product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.voice-product-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    overflow-y: auto;
    transition: transform 0.3s ease;
}


.voice-product-modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
}

.voice-product-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    color: #666;
}

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

/* ========================================================================
   ОСНОВНОЕ СОДЕРЖИМОЕ КАРТОЧКИ
   ======================================================================== */

.voice-product-card {
    padding: 20px 20px 120px; /* Отступ снизу для фиксированных кнопок */
}

.voice-product-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 30px 0;
    line-height: 1.3;
    text-align: center;
}

.voice-product-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ========================================================================
   ГАЛЕРЕЯ ИЗОБРАЖЕНИЙ
   ======================================================================== */

.voice-product-gallery {
    position: relative;
    text-align: center;
}

.voice-product-labels {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.voice-discount-label {
    background: #ff4444;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

.voice-product-main-image {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.voice-product-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.voice-product-thumbs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.voice-product-thumbs img:hover {
    transform: scale(1.05);
}

.voice-product-thumbs img.active {
    border-color: #007bff;
}

/* ========================================================================
   ИНФОРМАЦИЯ О ТОВАРЕ
   ======================================================================== */

.voice-product-code {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.voice-discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

.voice-discount-text {
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
    opacity: 0.9;
}

.voice-discount-percent {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

/* ========================================================================
   ЦЕНЫ
   ======================================================================== */

.voice-price-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

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

.voice-new-price {
    font-size: 28px;
    font-weight: 700;
    color: #007bff;
}

.voice-regular-price {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.voice-savings {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

/* ========================================================================
   НАЛИЧИЕ ТОВАРА
   ======================================================================== */

.voice-stock-text {
    font-weight: 600;
    margin-bottom: 10px;
    color: #28a745;
    font-size: 16px;
}

.voice-product-stock.no-stock .voice-stock-text {
    color: #dc3545;
}

.voice-stock-indicators {
    margin-bottom: 10px;
}

.voice-stock-indicators ul {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.voice-stock-indicators li {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #e9ecef;
}

.voice-stock-indicators li.red { background: #dc3545; }
.voice-stock-indicators li.orange { background: #fd7e14; }
.voice-stock-indicators li.green { background: #28a745; }
.voice-stock-indicators li.gray { background: #6c757d; }

.voice-stock-warning {
    color: #dc3545;
    font-size: 14px;
    margin: 8px 0;
}

.voice-stock-location {
    color: #666;
    font-size: 14px;
}

/* ========================================================================
   КОЛИЧЕСТВО ТОВАРА
   ======================================================================== */

.voice-quantity-block {
    text-align: center;
    margin-bottom: 30px;
}

.voice-quantity-block label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 16px;
}

.voice-quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.voice-qty-minus,
.voice-qty-plus {
    background: #f8f9fa;
    border: none;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: background-color 0.2s;
    color: #333;
}

.voice-qty-minus:hover,
.voice-qty-plus:hover {
    background: #e9ecef;
}

#voiceProductQuantity {
    width: 80px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 16px;
    font-weight: 600;
    background: white;
}

/* ========================================================================
   ХАРАКТЕРИСТИКИ
   ======================================================================== */

.voice-product-features {
    margin-bottom: 30px;
}

.voice-product-features h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.voice-features-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.voice-feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #dee2e6;
}

.voice-feature-row:last-child {
    border-bottom: none;
}

.voice-feature-name {
    padding: 12px 16px;
    background: #f8f9fa;
    font-weight: 600;
    border-right: 1px solid #dee2e6;
    font-size: 14px;
}

.voice-feature-value {
    padding: 12px 16px;
    background: white;
    font-size: 14px;
}

/* ========================================================================
   ФИКСИРОВАННЫЕ КНОПКИ ВНИЗУ (КАК В КОРЗИНЕ)
   ======================================================================== */

.voice-product-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #eee;
    padding: 15px 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.voice-product-buttons {
    display: flex;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.voice-add-to-list-btn {
    flex: 1;
    background: #FFF659;
    color: #333;
    border: 2px solid #FFF659;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.voice-add-to-list-btn:hover {
    background: #FFE900;
    border-color: #FFE900;
}

.voice-add-to-list-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.voice-btn-plus {
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 6v6m0 0v6m0-6h6m-6 0H6'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.voice-back-icon {
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.voice-request-price-btn {
    flex: 1;
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================================================
   СОСТОЯНИЯ ЗАГРУЗКИ И ОШИБОК
   ======================================================================== */

.voice-product-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.voice-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: voiceSpinnerRotate 1s linear infinite;
    margin-bottom: 20px;
}

.voice-loading-text {
    font-size: 18px;
    color: #666;
}

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

.voice-product-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.voice-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.voice-error-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.voice-error-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

.voice-error-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.voice-error-retry,
.voice-error-close {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
}

.voice-error-retry {
    background: #007bff;
    color: white;
}

.voice-error-retry:hover {
    background: #0056b3;
}

.voice-error-close {
    background: #6c757d;
    color: white;
}

.voice-error-close:hover {
    background: #545b62;
}

/* ========================================================================
   БЛОКИРОВКА ПРОКРУТКИ
   ======================================================================== */

body.voice-product-modal-open {
    overflow: hidden !important;
    position: static !important; /* ИЗМЕНЕНО: с fixed на static */
    width: 100% !important;
    height: 100vh !important;
}

/* ========================================================================
   АДАПТИВНОСТЬ
   ======================================================================== */

@media (max-width: 768px) {
    .voice-product-modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .voice-product-card {
        padding: 15px 15px 120px;
    }
    
    .voice-product-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .voice-product-content {
        gap: 20px;
    }
    
    .voice-product-main-image {
        max-width: 300px;
    }
    
    .voice-new-price,
    .voice-regular-price {
        font-size: 24px;
    }
    
    .voice-product-thumbs {
        justify-content: center;
    }
    
    .voice-thumbs img {
        width: 50px;
        height: 50px;
    }
    
    .voice-product-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
}

@media (max-width: 480px) {
    .voice-product-card {
        padding: 10px 10px 140px;
    }
    
    .voice-product-modal-header {
        padding: 10px 15px;
    }
    
    .voice-product-actions {
        padding: 10px 15px;
    }
    
    .voice-product-title {
        font-size: 18px;
    }
    
    .voice-product-main-image {
        max-width: 250px;
    }
    
    .voice-feature-name,
    .voice-feature-value {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .voice-quantity-controls {
        width: 100%;
        max-width: 200px;
    }
    
    #voiceProductQuantity {
        flex: 1;
        min-width: 60px;
    }
    
    .voice-back-btn,
    .voice-add-to-list-btn {
        padding: 12px 15px;
        font-size: 15px;
    }
}