* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: #FFFBEE;
    color: #000;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styles */
header {
    background: transparent;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    box-shadow: none;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 40px;
    padding: 30px 0;
}

.logo {
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo img { height: 140px; }

.logo i {
    margin-right: 10px;
    font-size: 32px;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 32px;
}
.menu-left ul { justify-content: flex-end; }
.menu-right ul { justify-content: flex-start; }

nav ul li {
    margin-left: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 20px;
    transition: all 0.3s ease;
}
.menu-left ul li a {
    color: white;
    padding: 6px 0;
    
    background: transparent;
    border: none;
}
.menu-left ul li a:hover {
    background: transparent;
}
.menu-right ul li a {
    padding: 6px 0;
}

nav ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.3);
}

/* Hero section */
.hero {
    background: url('assets/images/heronew.png') no-repeat center center/cover;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    display: block;
    padding: 0;
    margin: 0;
    position: relative;
    /* Обеспечиваем загрузку и плавное появление */
    background-attachment: scroll;
    will-change: background-image;
    /* Фоновый цвет на случай медленной загрузки */
    background-color: #333;
    opacity: 1;
    /* Оптимизация для GPU */
    transform: translateZ(0);
    /* Принудительное кэширование слоя */
    backface-visibility: hidden;
}

.hero.loaded {
    opacity: 1;
}

.hero::after {
    content: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 22px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.btn {
    display: inline-block;
    background: #000;
    color: #FFFBEE;
    padding: 14px 30px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Features section */
.features {
    padding: 80px 0;
    background: #FFFBEE;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: #000;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #000;
    margin: 15px auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: #FFFBEE;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 50px;
    color: #000;
    margin-bottom: 20px;
}

.feature-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #000;
}

/* Products section */
.products {
    padding: 100px 0;
    background: #FFFBEE;
}

.products-container {
    position: relative;
    overflow: visible;
}

.products-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    overflow: visible;
    transition: transform 0.5s ease;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.products-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.products-row:first-child {
    /* Верхний ряд - 3 товара */
}

.products-row:last-child {
    /* Нижний ряд - 2 товара, центрированы */
    justify-content: center;
    padding-left: 0;
    transform: none;
}

.products-row .product-card {
    flex: 0 0 auto;
    width: 280px;
    max-width: 280px;
    min-width: 0;
}

/* Фиксируем размеры изображения в карточке */
.product-card .product-img {
    height: 220px;
    width: 100%;
}

.products-row .product-card .btn {
    margin-top: auto;
}

.product-card {
    background: white;
    border: 3px solid #000;
    border-radius: 7px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    height: 450px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-img {
    height: 200px;
    background-color: #ddd;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.product-info {
    padding: 15px;
    background: white;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 25px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin-bottom: 10px;
    line-height: 25px;
}

.product-desc {
    margin-bottom: 15px;
    color: #000;
    font-size: 14px;
    flex-grow: 1;
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-controls:hover {
    background: rgba(0, 0, 0, 0.9);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: #000;
}

/* Admin Panel */
.admin-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    border-left: 2px solid #000;
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.admin-panel.open {
    right: 0;
}

.admin-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: #000;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1001;
}

.admin-form {
    margin-bottom: 20px;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-btn {
    padding: 8px 15px;
    background: #000;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.admin-btn.danger {
    background: #cc0000;
}

/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

/* Стили для списков в модальном окне */
.popup-content ul {
    list-style-type: disc;
    margin: 10px 0;
    padding-left: 25px;
}

.popup-content ul li {
    margin: 5px 0;
}

.popup-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 8px;
    color: #000;
}

.popup-content strong {
    color: #000;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.popup-img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: #f8f8f8;
}

/* Contact section */
.contact {
    padding: 80px 0;
    background: #FFFBEE;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-info {
    padding-right: 20px;
}

.contact-info h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #000;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 18px;
    color: #000;
}

.contact-info i {
    color: #000;
    margin-right: 10px;
    width: 20px;
}

.contact-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #000;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #000;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    color: #000;
}

.form-group textarea {
    min-height: 120px;
}

/* Footer */
footer {
    background: #000;
    color: #FFFBEE;
    padding: 40px 0 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.mobile-nav ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    text-align: center;
}

.mobile-nav li {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav li:last-child {
    border-bottom: none;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mobile-nav a:hover {
    color: #ccc;
}

.mobile-nav.active {
    display: block;
}

/* Desktop styles - larger font for menu on PC */
@media (min-width: 769px) {
    nav ul li a {
        font-size: 22px;
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        gap: 20px;
        padding: 20px 0;
    }
    
    .logo img {
        height: 80px;
    }
    
    nav ul {
        gap: 20px;
    }
    
    .products-row {
        gap: 15px;
    }
    
    .products-row .product-card {
        width: 260px;
    }
    
    .products-row .product-card {
        width: 370px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .header-content {
        grid-template-columns: 1fr;
        text-align: center;
        position: relative;
        justify-items: center;
    }
    
    .menu-left,
    .menu-right {
        display: none;
    }
    
    .logo {
        order: 1;
    }
    
    .logo img {
        height: 60px;
    }
    
    .hero {
        min-height: 70vh;
        height: 70vh;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .features {
        padding: 60px 0;
    }
    
    .products {
        padding: 60px 0;
    }
    
    .products-grid {
        max-width: 100%;
        padding: 10px 0;
    }
    
    .products-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .products-row:last-child {
        padding-left: 0;
        transform: none;
    }
    
    .products-row .product-card {
        max-width: 400px; /* Увеличиваем еще больше - до 400px */
        height: 480px; /* Увеличиваем высоту карточек */
    }
    
    .products-row .product-img {
        height: 220px; /* Увеличиваем высоту изображения */
    }
    }
    
    .slider-controls {
        display: none !important;
    }
    
    .contact {
        padding: 60px 0;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-info {
        padding-right: 0;
        margin-bottom: 0;
    }
    
    .contact-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        padding: 15px 0;
    }
    
    .logo img {
        height: 50px;
    }
    
    .hero {
        min-height: 60vh;
        height: 60vh;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .features,
    .products,
    .contact {
        padding: 40px 0;
    }
    
    .products-row .product-card {
        max-width: 420px; /* Делаем еще шире для маленьких экранов */
        height: 500px; /* Увеличиваем высоту */
    }
    
    .products-row .product-img {
        height: 240px; /* Увеличиваем высоту изображения для маленьких экранов */
    }
    
    .product-info {
        padding: 15px; /* Увеличиваем padding */
    }
    
    .product-info h3 {
        font-size: 17px; /* Увеличиваем шрифт */
    }
    
    .product-price {
        font-size: 19px; /* Увеличиваем шрифт цены */
    }
    
    .product-desc {
        font-size: 14px; /* Увеличиваем шрифт описания */
    }
    
    .btn {
        font-size: 16px;
        padding: 14px 20px; /* Увеличиваем padding кнопок */
    }
    
    .popup-content {
        margin: 10px;
        padding: 20px;
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .popup-img {
        height: 200px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Улучшения для кнопок на мобильных */
    .btn {
        min-height: 44px; /* Минимальная высота для touch */
        touch-action: manipulation; /* Убирает задержку tap */
    }
    
    /* Скрытие элементов на мобильных */
    .features img {
        max-width: 90%;
        height: auto;
    }
    
    /* Анимация для мобильного меню */
    .mobile-nav {
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-nav.active {
        transform: translateY(0);
    }
    
    /* Улучшение прокрутки на iOS */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Фиксация проблем с viewport на мобильных */
    @supports (-webkit-touch-callout: none) {
        .hero {
            min-height: calc(100vh - 60px);
        }
    }
}

/* Стили для touch устройств */
.touch-device .btn:hover {
    transform: none;
    box-shadow: none;
}

.touch-device .product-card:hover {
    transform: none;
}

.touch-device .feature-card:hover {
    transform: none;
}

/* Активное состояние для touch */
.btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.mobile-nav a:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Оптимизация производительности */
.products-grid {
    will-change: transform;
}

.mobile-nav {
    will-change: transform;
}

.mobile-menu-toggle {
    will-change: transform;
}
