/* Основные стили */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #2ecc71;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
.header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo i {
    color: var(--secondary);
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--secondary);
    color: white;
}

.contact-info .phone {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--dark);
    font-weight: bold;
    background-color: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
}

.contact-info .phone:hover {
    background-color: var(--secondary);
    color: white;
}

/* Герой секция */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.badge {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

/* Сетка товаров - ОБНОВЛЕНО */
.products-section {
    padding: 2rem 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-subtitle {
    color: var(--gray);
    margin-bottom: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Карточка товара - ПОЛНОСТЬЮ ПЕРЕДЕЛАНА ДЛЯ 3:4 */
.product-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    min-height: 220px;
    height: auto;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(255, 68, 68, 0.3);
}

/* Левая часть - фото в формате 3:4 (ВЫСОКИЙ, УЗКИЙ) */
.product-image {
    position: relative;
    width: 40%; /* Уже чем для 4:3 */
    min-width: 160px; /* Узкая минимальная ширина */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    overflow: hidden;
}

/* Контейнер для изображения 3:4 */
.image-container-3x4 {
    width: 100%;
    height: 0;
    padding-bottom: 133%; /* 4:3 = 75%, 3:4 = 133% (высота/ширина * 100%) */
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: white;
}

.image-container-3x4 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

/* Правая часть - информация о товаре */
.product-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-info-top {
    margin-bottom: auto;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Можно показать больше строк */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.product-code {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

/* Блок с ценой и наличием */
.product-price-stock {
    margin: 1rem 0;
}

.product-price {
    margin-bottom: 0.5rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.old-price {
    font-size: 1rem;
    color: var(--gray);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* Кнопка "Подробнее" в карточке */
.product-info .btn-primary {
    align-self: flex-start;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    border: none;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.product-info .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1c6ea4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Бейдж "Есть фотографии" для формата 3:4 */
.has-photos-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    backdrop-filter: blur(2px);
}

.has-photos-badge i {
    font-size: 14px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--secondary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary);
}

.btn-secondary {
    background-color: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background-color: #dde4e6;
}

.btn-call {
    background-color: var(--success);
    color: white;
}

/* Страница товара */
.breadcrumbs {
    padding: 1rem 0;
    color: var(--gray);
}

.breadcrumbs a {
    color: var(--secondary);
    text-decoration: none;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
    padding: 2rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.product-gallery {
    position: relative;
}

.main-image {
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: 10px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge-large {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
}

.product-title-detail {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.product-meta {
    display: flex;
    gap: 2rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.price-section {
    margin: 2rem 0;
}

.current-price-detail {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent);
}

.old-price-detail {
    font-size: 1.5rem;
    color: var(--gray);
    text-decoration: line-through;
    margin-bottom: 0.5rem;
}

.discount-badge {
    display: inline-block;
    background-color: var(--success);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-weight: bold;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    margin: 1rem 0;
    font-size: 1.1rem;
}

.product-description {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--light);
    border-radius: 5px;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.product-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--light);
    border-radius: 5px;
}

/* Стили для фотографий товара */
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail-item {
    width: 70px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail-item:hover {
    border-color: #4361ee;
    transform: translateY(-2px);
}

.thumbnail-item.active {
    border-color: #4361ee;
    border-width: 3px;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Секция всех фотографий */
.all-photos-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.all-photos-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.all-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.all-photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.all-photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.all-photo-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.photo-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4361ee;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Галерея */
.gallery-item {
    display: block;
}

.main-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.main-photo {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: white;
}

/* Страница контактов */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.contact-card {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.map-section {
    margin: 4rem 0;
}

.map-placeholder {
    background-color: var(--light);
    padding: 3rem;
    text-align: center;
    border-radius: 10px;
    margin-top: 1rem;
}

.map-placeholder i {
    font-size: 4rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.map-frame {
    margin-top: 2rem;
    padding: 2rem;
    background-color: white;
    border-radius: 5px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--light);
    border-radius: 5px;
}

/* Футер */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section a {
    display: block;
    color: #ddd;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ddd;
}

.no-products {
    text-align: center;
    padding: 4rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.no-products i {
    font-size: 4rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-features {
        grid-template-columns: 1fr;
    }
    
    /* Адаптивность карточек товаров для мобильных */
    .product-card {
        flex-direction: column;
        height: auto;
    }
    
    .product-image {
        width: 100%;
        min-width: auto;
        height: 250px; /* Выше для формата 3:4 */
        padding: 20px;
    }
    
    .image-container-3x4 {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        padding-bottom: 133%; /* Сохраняем пропорции 3:4 */
    }
    
    .product-info {
        padding: 1.2rem;
    }
    
    .product-info .btn-primary {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .has-photos-badge {
        top: 15px;
        right: 15px;
        bottom: auto;
        background: rgba(67, 97, 238, 0.9);
    }
    
    .all-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .all-photo-item img {
        height: 150px;
    }
    
    .thumbnail-gallery {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .thumbnail-item {
        flex-shrink: 0;
    }
}

@media (max-width: 576px) {
    .products-grid {
        gap: 1rem;
    }
    
    .product-card {
        margin-bottom: 0.5rem;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-title {
        -webkit-line-clamp: 2;
        min-height: 2.4em;
    }
    
    .all-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .all-photo-item img {
        height: 120px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        height: auto;
    }
    
    .product-badge {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .product-image {
        height: 200px;
    }
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}