/* --- Variables & Reset --- */
:root {
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Jost', sans-serif;
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-light: #f5f5f5;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.main-header.scrolled {
    border-bottom: 1px solid #eaeaea;
    padding: 10px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 10px;
    max-width: 1600px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-list { display: flex; list-style: none; gap: 30px; }
.nav-list a { text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

/* Mega Menu */
.has-megamenu { position: relative; }
.megamenu {
    position: absolute;
    top: 100%; left: 0;
    background: var(--color-bg);
    padding: 40px;
    display: flex;
    gap: 50px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
}
.has-megamenu:hover .megamenu { opacity: 1; visibility: visible; }
.megamenu h3 { font-family: var(--font-heading); margin-bottom: 15px; font-size: 1.2rem; }
.megamenu a { display: block; margin-bottom: 10px; text-transform: none; color: #555; }
.megamenu a:hover { color: #000; }

.header-actions { display: flex; gap: 20px; align-items: center; }
.lang-switcher a { font-size: 0.8rem; opacity: 0.5; }
.lang-switcher a.active { opacity: 1; font-weight: 500; }

/* --- Hero Banner --- */
.hero {
    height: 100vh;
    background: url('https://images.unsplash.com/photo-1469334031218-e382a71b716b?q=80&w=2000&auto=format&fit=crop') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-bg);
}
.hero h1 { font-family: var(--font-heading); font-size: 4rem; font-weight: 400; margin-bottom: 20px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.hero p { font-size: 1.2rem; margin-bottom: 30px; font-weight: 300; }
.btn-primary { background: var(--color-bg); color: var(--color-text); padding: 15px 40px; text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem; transition: var(--transition); }
.btn-primary:hover { background: var(--color-text); color: var(--color-bg); }

/* --- Categories Grid --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 500px;
    gap: 5px;
    padding: 5px;
}
.grid-item { position: relative; overflow: hidden; }
.grid-item.large { grid-column: span 2; grid-row: span 2; height: 1000px; }
.grid-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s ease; }
.grid-item:hover img { transform: scale(1.03); }
.grid-text { position: absolute; bottom: 40px; left: 40px; color: var(--color-bg); }
.grid-text h2 { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 400; }

/* --- Footer --- */
.main-footer { text-align: center; padding: 40px; border-top: 1px solid #eaeaea; font-size: 0.9rem; color: #777; }

/* --- Mobile / Адаптивность --- */
.menu-toggle { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.menu-toggle span { width: 25px; height: 2px; background: var(--color-text); }

@media (max-width: 1024px) {
    .categories-grid { grid-template-columns: 1fr; grid-auto-rows: 400px; }
    .grid-item.large { grid-column: span 1; grid-row: span 1; height: 400px; }
    .nav-list { display: none; } /* Здесь в реальном проекте добавляется логика мобильного меню */
    .menu-toggle { display: flex; }
}
/* --- Product Page --- */
.product-page {
    display: flex;
    max-width: 1600px;
    margin: 120px auto 0; /* Отступ сверху от шапки */
    padding: 0 40px 100px;
    gap: 80px;
    align-items: flex-start; /* Важно: без этого position: sticky не будет работать правильно */
}

.product-gallery {
    flex: 6.5; /* Галерея занимает больше места */
    display: flex;
    flex-direction: column;
    gap: 2px; /* Тонкая линия между фото */
}

.product-image-wrapper {
    overflow: hidden;
    background: var(--color-light);
    cursor: zoom-in;
}

.product-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-image-wrapper:hover img {
    transform: scale(1.04); /* Легкий, премиальный эффект зума */
}

.product-info-sticky {
    flex: 3.5;
    position: sticky;
    top: 120px; /* Отступ от верхнего края экрана при скролле */
    padding: 20px 0;
}

.product-sku { font-size: 0.75rem; color: #888; letter-spacing: 2px; margin-bottom: 15px; text-transform: uppercase; }
.product-title { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 400; margin-bottom: 25px; line-height: 1.1; }
.product-price { font-size: 1.4rem; margin-bottom: 40px; font-weight: 400; }

.btn-block { width: 100%; display: block; text-align: center; cursor: pointer; }
.btn-primary { border: 1px solid var(--color-text); }
.btn-secondary { 
    background: transparent; 
    color: var(--color-text); 
    padding: 15px 40px; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 0.9rem; 
    border: 1px solid #eaeaea; 
    transition: var(--transition); 
}
.btn-secondary:hover { border-color: var(--color-text); }

.product-description { 
    margin-top: 50px; 
    font-size: 0.95rem; 
    color: #444; 
    border-top: 1px solid #eaeaea; 
    padding-top: 30px; 
    line-height: 1.8; 
}

/* Мобильная адаптивность страницы товара */
@media (max-width: 1024px) {
    .product-page { flex-direction: column; padding: 0 20px 50px; margin-top: 80px; gap: 40px; }
    .product-info-sticky { position: static; width: 100%; padding: 0; }
    .product-gallery { width: 100%; }
}
/* --- Forms & Auth --- */
.auth-container, .profile-container {
    max-width: 500px;
    margin: 150px auto 100px;
    padding: 40px;
    background: var(--color-bg);
}

.profile-container {
    max-width: 800px;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 25px;
}

.form-group input {
    width: 100%;
    padding: 15px 0;
    border: none;
    border-bottom: 1px solid #ccc;
    font-family: var(--font-body);
    font-size: 1rem;
    background: transparent;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-bottom: 1px solid var(--color-text);
}

.msg-error { color: #d9534f; margin-bottom: 20px; text-align: center; font-size: 0.9rem; }
.msg-success { color: #5cb85c; margin-bottom: 20px; text-align: center; font-size: 0.9rem; }

.auth-link {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9rem;
    color: #777;
}

.auth-link a { color: var(--color-text); font-weight: 500; border-bottom: 1px solid var(--color-text); }

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 20px;
}

.btn-logout {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    border-bottom: 1px solid transparent;
}
.btn-logout:hover { color: var(--color-text); border-bottom: 1px solid var(--color-text); }
/* --- Featured Products Section --- */
.featured-section {
    padding: 100px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.section-subtitle {
    color: #777;
    font-size: 1rem;
    letter-spacing: 1px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.product-card {
    text-align: center;
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--color-light);
    margin-bottom: 20px;
}

.card-img-wrapper img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.product-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .card-overlay {
    opacity: 1;
}

.view-details {
    background: var(--color-bg);
    color: var(--color-text);
    padding: 10px 20px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.product-card:hover .view-details {
    transform: translateY(0);
}

.card-info {
    padding: 0 10px;
}

.card-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: var(--color-text);
}

.card-price {
    font-size: 1rem;
    color: #555;
}
/* --- Интерактив мобильного меню --- */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .main-nav {
        position: fixed;
        top: 0;
        left: -100%; /* Скрыто за левым краем */
        width: 80%; /* Занимает 80% экрана */
        height: 100vh;
        background: var(--color-bg);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .main-nav.active {
        left: 0; /* Выезжает при клике */
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .nav-list a {
        font-size: 1.5rem;
    }

    /* Отключаем Megamenu на мобильных (заменяем на простые ссылки) */
    .has-megamenu .megamenu {
        display: none !important;
    }
}