/* --- ОСНОВНЫЕ СТИЛИ И ПЕРЕМЕННЫЕ --- */
:root {
    --font-main: 'Manrope', sans-serif;
    --accent-blue: #0d6efd;
    --accent-blue-hover: #0b5ed7;
    --accent-orange: #fd7e14;
    --accent-orange-hover: #e66a00;
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #212529;
    --subtext-color: #6c757d;
    --border-color: #dee2e6;
    --danger-color: #dc3545;
}

html {
    scroll-behavior: smooth;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: url('i.png');
    background-repeat: repeat;
    background-attachment: fixed;
}

.container { max-width: 1300px; margin: 0 auto; padding: 0 20px; }

/* --- СТИЛИ ШАПКИ И НАВИГАЦИИ --- */
#main-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 15px 0; background-color: transparent; transition: background-color 0.3s, backdrop-filter 0.3s, border-bottom 0.3s; }
#main-header.scrolled { background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); }

#main-header .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

#main-header .container .logo {
    grid-column: 2 / 3;
    justify-self: center;
}

#main-header .container .main-nav {
    grid-column: 1 / 2;
    justify-self: start;
}

#main-header .container .header-actions {
    grid-column: 3 / 4;
    justify-self: end;
}

.logo { display: block; }
.logo img { max-height: 40px; display: block; }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a, .header-actions .main-nav-link { color: #ffffff; text-shadow: 0 1px 3px rgba(0,0,0,0.2); text-decoration: none; font-weight: 600; font-size: 16px; position: relative; padding: 5px 0; transition: color 0.3s; }
#main-header.scrolled .main-nav a, #main-header.scrolled .header-actions .main-nav-link { color: var(--text-color); text-shadow: none; }
.main-nav a::after, .header-actions .main-nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-orange); transition: width 0.3s; }
.main-nav a:hover::after, .header-actions .main-nav-link:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 25px; }
.header-actions .action-link { color: #ffffff; text-shadow: 0 1px 3px rgba(0,0,0,0.2); text-decoration: none; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; background: none; border: none; cursor: pointer; transition: color 0.3s; }
#main-header.scrolled .header-actions .action-link { color: var(--text-color); text-shadow: none; }
.header-actions .action-link i { font-size: 20px; }
.cart-link { position: relative; }
.cart-count { position: absolute; top: -5px; right: -10px; background-color: var(--accent-orange); color: white; font-size: 12px; width: 20px; height: 20px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; }

/* --- СТИЛИ ВЫПАДАЮЩЕГО МЕНЮ КАТАЛОГА --- */
.main-nav .dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 15px; /* ИЗМЕНЕНИЕ: Добавляем "мост" для курсора */
    margin-bottom: -15px; /* ИЗМЕНЕНИЕ: Компенсируем отступ */
}

.main-nav .dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav .dropdown .nav-link i {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--surface-color);
    min-width: 800px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0 0 16px 16px;
    padding: 30px;
    margin-top: 0; /* ИЗМЕНЕНИЕ: Убираем отступ, создававший проблему */
    border-top: 3px solid var(--accent-orange);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .nav-link i {
    transform: rotate(180deg);
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.dropdown-column h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.dropdown-column h4 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.dropdown-column h4 a:hover {
    color: var(--accent-orange);
}

.dropdown-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-column ul li {
    margin-bottom: 10px;
}

.dropdown-column ul li a {
    text-decoration: none;
    color: var(--subtext-color);
    font-size: 0.95rem;
    transition: color 0.2s, padding-left 0.2s;
}

.dropdown-column ul li a:hover {
    color: var(--accent-blue);
    padding-left: 5px;
}

/* --- Стили для слайдера --- */
.promo-slider {
    position: relative;
    width: 100%;
    height: 65vh;
    max-height: 600px;
    overflow: hidden;
}
.promo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    z-index: 1;
}
.promo-slide.active {
    opacity: 1;
    z-index: 2;
}
.promo-slide::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 3;
}
.promo-content {
    position: relative;
    z-index: 4;
    padding: 0 15px;
}
.promo-content h2 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
}
.promo-content p {
    font-size: 1.5rem;
    max-width: 600px;
    margin: 0 auto 30px;
}
.promo-content .cta-button {
    display: inline-block;
    background-color: var(--accent-orange);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.3s;
}
.promo-content .cta-button:hover {
    background-color: var(--accent-orange-hover);
    transform: translateY(-3px);
}
.promo-slider .carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color); border-radius: 50%; width: 50px; height: 50px;
    cursor: pointer; z-index: 11;
    font-size: 20px; color: var(--text-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: background-color 0.3s, transform 0.3s;
}
.promo-slider .carousel-btn:hover { background-color: var(--accent-blue); color: white; transform: translateY(-50%) scale(1.1); }
.promo-slider .carousel-btn.prev { left: 15px; }
.promo-slider .carousel-btn.next { right: 15px; }

/* --- АНИМАЦИИ --- */
.fade-in { animation: fadeIn 1s ease-in-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); }}
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* --- СЕКЦИИ --- */
.section-title { text-align: center; font-size: 2.5rem; font-weight: 800; margin-bottom: 50px; color: var(--text-color); }
.categories-section, .product-showcase, .discount-products, .articles-section { padding: 80px 0; }

/* Категории (Сетка) */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 25px; }
.category-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    border: 2px solid transparent;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}
.category-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-orange);
}
.category-card-image { height: 180px; width: 100%; }
.category-card-image img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.category-card h3 { font-size: 1.4rem; margin: 20px 25px 15px 25px; color: var(--accent-blue); }
.category-card ul { list-style: none; padding: 0 25px 25px 25px; }
.category-card ul li { margin-bottom: 8px; }
.category-card ul li a { color: var(--subtext-color); text-decoration: none; transition: color 0.2s, padding-left 0.2s; position: relative; display: inline-block; }
.category-card ul li a:hover { color: var(--accent-orange); padding-left: 12px; }
.category-card ul li a::before { content: '»'; position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 0.2s; color: var(--accent-orange); }
.category-card ul li a:hover::before { opacity: 1; }

/* 3D Карточки Товаров (общие стили) */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; }
.product-card-link { text-decoration: none; display: flex; flex-direction: column; flex-grow: 1; color: inherit; }
.product-card-3d {
    background-color: var(--surface-color);
    border-radius: 15px;
    padding: 20px;
    transform-style: preserve-3d;
    transition: transform 0.5s, border-color 0.3s;
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card-3d:hover {
    transform: translateZ(20px);
    border-color: var(--accent-orange);
}
.product-content { text-align: center; transform: translateZ(20px); display: flex; flex-direction: column; flex-grow: 1; }
.product-image { height: 200px; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; }
.product-image img { max-width: 100%; max-height: 100%; transition: transform 0.5s; }
.product-card-3d:hover .product-image img { transform: translateZ(50px) rotateY(15deg); }
.product-card-3d h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-color); }
.price { font-size: 1.4rem; font-weight: 800; color: var(--accent-blue); margin-top: auto; padding-top: 15px; }
.add-to-cart-btn { width: 100%; padding: 12px; background-color: var(--accent-blue); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background-color 0.3s; margin-top: 15px; text-decoration: none; text-align: center;}
.add-to-cart-btn:hover { background-color: var(--accent-blue-hover); }
.product-label.discount { position: absolute; top: 15px; left: 15px; background-color: var(--danger-color); color: white; padding: 5px 10px; border-radius: 5px; font-size: 0.9rem; font-weight: bold; z-index: 5; transform: translateZ(25px); }

/* Стили для краткой характеристики */
.product-note {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    margin-bottom: 15px;
    height: 54px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    hyphens: auto;
}

.product-card-3d h3 {
    word-wrap: break-word;
    hyphens: auto;
}

/* Секция Статей */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.article-card { background-color: var(--surface-color); border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; text-decoration: none; color: var(--text-color); display: block; transition: transform 0.3s, box-shadow 0.3s; }
.article-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.article-image img { width: 100%; height: 220px; object-fit: cover; }
.article-content { padding: 25px; }
.article-tag { display: inline-block; padding: 5px 12px; background-color: var(--accent-blue); color: white; border-radius: 50px; font-size: 0.8rem; font-weight: 600; margin-bottom: 15px; }
.article-content h3 { font-size: 1.4rem; margin-bottom: 10px; }
.article-content p { color: var(--subtext-color); line-height: 1.7; }

/* ПОДВАЛ */
.main-footer { background-color: #ffffff; padding: 60px 0 0; border-top: 1px solid var(--border-color); box-shadow: 0 -5px 15px rgba(0,0,0,0.05); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.footer-column.about .logo { margin-bottom: 20px; }
.footer-column.about .logo img { max-height: 50px; width: auto; }
.footer-column h4 { font-size: 1.2rem; margin-bottom: 20px; color: var(--text-color); }
.footer-column ul { list-style: none; }
.footer-column ul li a, .footer-column p { color: var(--subtext-color); text-decoration: none; margin-bottom: 10px; display: block; }
.footer-column ul li a:hover { color: var(--accent-blue); }
.footer-column p a { color: inherit; text-decoration: none; display: inline; }
.footer-column p a:hover { color: var(--accent-blue); text-decoration: underline; }
.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons a { color: var(--subtext-color); font-size: 24px; }
.social-icons a:hover { color: var(--accent-blue); }
.footer-bottom { text-align: center; padding: 20px 0; border-top: 1px solid var(--border-color); color: var(--subtext-color); }

/* СТИЛИ ДЛЯ ПОИСКА */
.search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding-top: 15vh; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.search-overlay.active { opacity: 1; visibility: visible; }
.close-search-btn { position: absolute; top: 40px; right: 40px; background: none; border: none; color: white; font-size: 48px; cursor: pointer; line-height: 1; }
.search-content { width: 100%; max-width: 700px; position: relative; }
.search-input { width: 100%; background: none; border: none; border-bottom: 3px solid rgba(255, 255, 255, 0.5); color: white; font-size: 2.5rem; font-weight: 600; padding: 15px 0; text-align: center; outline: none; transition: border-color 0.3s; }
.search-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.search-input:focus { border-bottom-color: var(--accent-orange); }
.search-results-container { margin-top: 30px; max-height: 50vh; overflow-y: auto; }
.search-result-item { display: flex; align-items: center; padding: 15px; margin-bottom: 10px; background-color: rgba(255, 255, 255, 0.05); border-radius: 8px; text-decoration: none; transition: background-color 0.3s; }
.search-result-item:hover { background-color: rgba(255, 255, 255, 0.1); }
.search-result-image { width: 50px; height: 50px; object-fit: contain; margin-right: 15px; }
.search-result-info { display: flex; flex-direction: column; }
.search-result-title { color: white; font-weight: 600; font-size: 1.1rem; }
.search-result-price { color: var(--subtext-color); font-size: 0.9rem; }
.search-no-results { color: white; text-align: center; padding: 20px; font-size: 1.2rem; }

/* СТИЛИ ДЛЯ УВЕДОМЛЕНИЯ О ДОБАВЛЕНИИ В КОРЗИНУ */
.cart-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    z-index: 3000;
    transform: translateY(200%);
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-content i {
    font-size: 1.5rem;
}

.notification-content span {
    font-weight: 600;
}

/* --- АДАПТИВНОСТЬ --- */

@media (max-width: 992px) {
    .main-nav, .header-actions .action-link span { display: none; }
    #main-header .container {
        display: flex;
        justify-content: space-between;
    }
    #main-header .container .logo {
        justify-self: start;
    }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .promo-slider { height: 50vh; }
    .promo-content h2 { font-size: 2.2rem; }
    .promo-content p { font-size: 1.1rem; }
    .promo-content .cta-button { padding: 12px 24px; font-size: 0.9rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .social-icons { justify-content: center; }
    .sections-section { padding: 60px 0; }
    .section-title { font-size: 2rem; }

    .product-grid, .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .category-card h3 { font-size: 1.1rem; margin: 15px; }
    .category-card ul { padding: 0 15px 15px 15px; }
    .category-card ul li a { font-size: 0.9rem; }

    .product-card-3d { padding: 15px; }
    .product-image { height: 160px; margin-bottom: 15px; }
    .product-card-3d h3 { font-size: 1rem; }
    .product-note { font-size: 0.8rem; height: 48px; -webkit-line-clamp: 3; }
    .price { font-size: 1.2rem; }
    .add-to-cart-btn { font-size: 0.9rem; padding: 10px; }
}

@media (max-width: 480px) {
    .promo-slider { height: 45vh; }
    .promo-content h2 { font-size: 1.6rem; }
    .promo-content p { font-size: 0.9rem; margin-bottom: 20px; }
    .promo-content .cta-button { padding: 10px 20px; font-size: 0.8rem; }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        text-align: center;
    }
    .social-icons {
        justify-content: center;
    }
    .search-input {
        font-size: 1.8rem;
    }
    .close-search-btn { top: 20px; right: 20px; }
    .category-card ul { display: none; }
    .product-note { display: none; }
    .product-image { height: 120px; }
    .product-card-3d h3 { font-size: 0.9rem; line-height: 1.3; }
    .price { font-size: 1.1rem; padding-top: 10px; }
    .add-to-cart-btn { font-size: 0.8rem; padding: 8px; }
}
