/* assets/css/shop.css */

/* --- СЕТКА МАГАЗИНА (Список) --- */
/* --- СЕТКА МАГАЗИНА (Исправленная центровка) --- */
.shop-grid { 
    display: grid; 
    /* auto-fit: создает столько колонок, сколько влезет.
       minmax(300px, 1fr): колонка минимум 300px, но может растягиваться (1fr).
    */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Центрируем саму сетку по горизонтали */
    justify-content: center;
    gap: 30px; 
    margin-bottom: 60px; 
    width: 100%;
}

.product-card {
    background: #fff; 
    border-radius: 10px; 
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); 
    border: 1px solid #eee;
    transition: all 0.3s ease; 
    text-decoration: none; 
    color: inherit;
    display: flex; 
    flex-direction: column; 
    position: relative;
    
    /* --- РАЗМЕРЫ --- */
    /* Карточка занимает всю ширину своей ячейки грида */
    width: 100%;
    /* Ограничиваем максимальную ширину. 
       Если товар один, он не растянется на весь экран, а будет шириной 450px по центру.
       Можете увеличить/уменьшить это значение по вкусу.
    */
    max-width: 450px;
    /* Центрируем карточку внутри её ячейки (на случай, если ячейка шире max-width) */
    margin: 0 auto;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.12); }

.product-img-box { width: 100%; height: 320px; position: relative; overflow: hidden; background: #f9f9f9; }
.product-img-box img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; transition: opacity 0.4s ease; }
.img-hover { opacity: 0; z-index: 2; }
.img-main { opacity: 1; z-index: 1; }
.product-card:hover .img-hover { opacity: 1; }

.product-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.product-title { font-family: 'Bebas Neue Cyrillic', sans-serif; font-size: 1.6rem; margin-bottom: 5px; line-height: 1.1; color: #333; }
.product-price { font-family: 'Bebas Neue Cyrillic', sans-serif; font-size: 1.4rem; color: #333; margin-bottom: 10px; }
.btn-buy-card { margin-top: auto; width: 100%; text-align: center; z-index: 5; position: relative; }


/* --- СТРАНИЦА ТОВАРА (ДЕТАЛЬНАЯ) --- */
.product-detail-container { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    gap: 40px; 
    margin-bottom: 80px; 
    align-items: start; 
    max-width: 100%; /* Защита от вылезания */
}

/* --- ВАЖНО: АДАПТИВ ДЛЯ ТЕЛЕФОНА --- */
@media (max-width: 900px) {
    .product-detail-container { 
        display: flex;        /* Меняем Grid на Flex */
        flex-direction: column; /* Блоки друг под другом */
        gap: 30px; 
        width: 100%;
    }
    
    .detail-info {
        width: 100%;          /* Занимает всю ширину */
        min-width: 0;         /* Магия CSS: разрешает блоку сжиматься */
        box-sizing: border-box;
    }

    .detail-title { font-size: 2rem !important; margin-top: 10px; line-height: 1.1; word-wrap: break-word; }
    
    /* Делаем галерею на весь экран */
    .gallery-wrapper { width: 100%; position: static !important; }
    
    /* Уменьшаем кнопку */
    .btn-buy-lg { width: 100%; padding: 15px !important; font-size: 1.1rem !important; }
}

/* Галерея */
.gallery-wrapper { display: flex; flex-direction: column; gap: 15px; position: sticky; top: 100px; }

.main-view { width: 100%; aspect-ratio: 1/1; background: #f5f5f5; border-radius: 12px; overflow: hidden; position: relative; border: 1px solid #eee; }
.main-view img { width: 100%; height: 100%; object-fit: cover; display: none; }
.main-view video { width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.main-view .active { display: block; }

.thumbnails { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.thumbnails::-webkit-scrollbar { display: none; }
.thumb { width: 70px; height: 70px; flex-shrink: 0; border-radius: 8px; cursor: pointer; opacity: 0.6; border: 2px solid transparent; object-fit: cover; background: #eee; transition: 0.2s; }
.thumb.active { opacity: 1; border-color: #facc15; }






/* Инфо блока товара */
.detail-title { font-family: 'Bebas Neue Cyrillic', sans-serif; font-size: 3rem; line-height: 1; margin-bottom: 10px; text-transform: uppercase; color: #333; }
.detail-price { font-family: 'Bebas Neue Cyrillic', sans-serif; font-size: 2.2rem; color: #333; margin-bottom: 20px; }

/* Описание текста (ИСПРАВЛЕНО ПЕРЕПОЛНЕНИЕ) */
.detail-desc { 
    font-family: 'Roboto', sans-serif; 
    line-height: 1.6; 
    color: #555; 
    font-size: 1rem; 
    margin-bottom: 30px; 
    white-space: normal;       /* Обычный перенос строк */
    word-wrap: break-word;     /* Ломать длинные слова */
    overflow-wrap: break-word; /* Современный аналог */
    max-width: 100%;           /* Не шире контейнера */
}

.btn-buy-lg { font-size: 1.3rem; padding: 18px; text-transform: uppercase; letter-spacing: 1px; width: 100%; border-radius: 8px; }

/* Аккордеоны */
.product-accordion { border-top: 1px solid #eee; margin-top: 10px; width: 100%; }
.product-accordion:last-child { border-bottom: 1px solid #eee; }
.product-accordion summary { padding: 18px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-family: 'Roboto', sans-serif; font-size: 1.1rem; }
.product-accordion summary::after { content: '+'; font-size: 1.5rem; font-weight: 300; transition: 0.2s; }
.product-accordion[open] summary::after { transform: rotate(45deg); }
.accordion-content { padding-bottom: 20px; color: #666; line-height: 1.6; font-size: 0.95rem; font-family: 'Roboto'; word-wrap: break-word; }
.instruction-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 15px; }
.inst-media { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; cursor: zoom-in; background: #eee; }

/* --- ОПРОСНИК --- */
.success-message, .error-message { max-width: 700px; margin: 0 auto 20px; padding: 15px; text-align: center; color: white; border-radius: 5px; }
.success-message { background: #4CAF50; }
.error-message { background: #f44336; }

.contacts-grid { margin: 40px auto; max-width: 1200px; display: flex; justify-content: center; }
.contact-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.08); border: 1px solid #eee; width: 100%; max-width: 700px; }
.contact-header { background: var(--dark-gray); color: #fff; padding: 25px; text-align: center; position: relative; }
.contact-position { font-family: 'Bebas Neue Cyrillic'; font-size: 1.8rem; margin-bottom: 10px; }
.contact-details { padding: 25px; }

.survey-form-light { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.survey-form-light label { font-family: 'Roboto'; font-weight: 600; color: #333; text-align: right; font-size: 0.9em; }
.survey-form-light label .optional { font-weight: 400; color: #777; font-size: 0.9em; }
.survey-form-light input, .survey-form-light select, .survey-form-light textarea { width: 100%; padding: 10px; border-radius: 8px; border: 2px solid #ddd; background-color: #fff; color: #333; font-size: 1em; font-family: 'Roboto'; }
.survey-form-light input:focus, .survey-form-light select:focus, .survey-form-light textarea:focus { border-color: #facc15; outline: none; }
.survey-form-light textarea { min-height: 100px; resize: vertical; grid-column: 1 / -1; }
@media(max-width: 768px) { .survey-form-light { grid-template-columns: 1fr; gap: 8px; } .survey-form-light label { text-align: left; } }

/* --- ФУТЕР МАГАЗИНА --- */
.vote-section {
  background: #f8f8f8; 
  border-radius: 15px;
  padding: 40px;
  max-width: 800px;
  margin: 60px auto;
  text-align: center;
}

.vote-title {
  font-family: 'Bebas Neue Cyrillic', sans-serif;
  font-size: 2.2rem;
  margin-bottom: 25px;
  text-transform: uppercase;
  color: #333; 
}

.doc-link:hover { color: #facc15 !important; transition: 0.3s; }

/* --- МОДАЛКИ --- */
.modal-overlay, .lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 3000; align-items: center; justify-content: center; }
.modal-overlay.active, .lightbox.active { display: flex; }
.modal-window { background: #fff; padding: 25px; border-radius: 12px; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; position: relative; }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; color:#999; }
.doc-content h3 { font-family: 'Bebas Neue Cyrillic'; font-size: 1.5rem; margin-bottom: 15px; }
.doc-content p { font-size: 0.9rem; line-height: 1.5; margin-bottom: 10px; color: #333; text-align: left; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: white; font-size: 3rem; cursor: pointer; z-index: 3001; }


/* --- КОРЗИНА И СЧЕТЧИК (FLOAT) --- */
.cart-fixed-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--dark-gray);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: transform 0.3s;
    cursor: pointer;
}
.cart-fixed-icon:hover { transform: scale(1.05); }

.cart-fixed-icon svg {
    width: 30px;
    height: 30px;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336; /* Красный для внимания */
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    display: none; /* Скрыто по умолчанию */
}