@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary: #2a4128;
    --primary-light: #4a6d47;
    --primary-dark: #1a291a;
    --primary-glass: rgba(42, 65, 40, 0.9);
    
    --accent: #ffc107;
    --accent-hover: #ffb300;
    --accent-soft: #fff8e1;
    
    --secondary: #6b4423;
    --secondary-light: #8b5d35;
    
    /* Neutrals */
    --white: #ffffff;
    --bg-main: #fcfdfc;
    --bg-alt: #f1f5f1;
    --text-main: #1c1c1c;
    --text-muted: #5e665e;
    --border: #e2e8e2;
    
    /* Effects */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    /* Transition */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    zoom: 0.8; /* Уменьшение всего контента на 20% */
}

h1, h2, h3, h4 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    transition: var(--transition);
}

.header.scrolled {
    padding: 0.7rem 0;
    background: var(--primary-glass);
    color: var(--white);
    border-bottom: none;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.header.scrolled .logo h1 {
    color: var(--white);
}

.logo p {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.7;
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.main-nav a:hover {
    color: var(--primary);
    background: var(--bg-alt);
}

.header.scrolled .main-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--primary-dark);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--white);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 180px 0 100px;
    background: linear-gradient(135deg, #f0f4ef 0%, #ffffff 100%);
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 40%;
    height: 80%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    z-index: 0;
    border-radius: 50%;
    filter: blur(60px);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    text-align: left;
}

.hero-section h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    letter-spacing: -1px;
}

.hero-section p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 550px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Grid & Cards */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    /* Не используем position: relative, чтобы не создавать stacking context */
}

.product-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative; /* Обязательно для позиционирования popover */
    overflow: visible !important; /* Чтобы окно не обрезалось */
    /* НЕ устанавливаем z-index по умолчанию - это создает stacking context */
}

/* Увеличиваем z-index ТОЛЬКО для активной карточки - это создаст новый stacking context */
.product-card.active,
.product-card:hover {
    z-index: 100;
    isolation: isolate; /* Создаем новый stacking context для Chrome */
}

/* Скрываем popover по умолчанию ПРИНУДИТЕЛЬНО */
.product-popover {
    position: absolute !important;
    display: block !important;
    top: 0;
    left: calc(100% + 20px);
    width: 320px;
    background: #ffffff !important;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 50px rgba(0,0,0,0.2) !important;
    border: 1px solid var(--border);
    z-index: 1 !important; /* Относительно родительской карточки, не нужно большое значение */
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

/* Появление */
.product-card:hover .product-popover,
.product-popover.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
}

.product-popover h5 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-soft);
    padding-bottom: 0.5rem;
}

.popover-content {
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding-right: 10px;
    line-height: 1.5;
}

.popover-content p {
    margin-bottom: 1rem;
}

/* Стилизация скролла */
.popover-content::-webkit-scrollbar {
    width: 5px;
}
.popover-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.close-popover {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: var(--bg-alt);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.close-popover:hover {
    background: var(--accent);
    color: var(--primary-dark);
}

/* Адаптивность для планшетов */
@media (max-width: 1200px) {
    .product-popover {
        left: 50%;
        top: auto;
        bottom: calc(100% + 20px); /* Сверху */
        transform: translate(-50%, -15px);
        width: 300px;
    }
    
    .product-popover::before {
        top: auto;
        bottom: -10px;
        left: 50%;
        margin-left: -10px;
        border-left: none;
        border-bottom: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
    
    .product-card:hover .product-popover {
        transform: translate(-50%, 0);
    }
}

/* Адаптивность для телефонов - фиксированное окно */
@media (max-width: 600px) {
    .product-popover {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: 90%;
        max-height: 80vh;
        bottom: auto;
        box-shadow: 0 0 100px rgba(0,0,0,0.5);
    }
    
    .product-popover::before {
        display: none;
    }
    
    .product-card:hover .product-popover {
        transform: translate(-50%, -50%) scale(1);
    }
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.product-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.btn-cart {
    width: 100%;
    background: var(--bg-alt);
    color: var(--primary);
    border: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.product-card:hover .btn-cart {
    background: var(--primary);
    color: var(--white);
}

/* USPs */
.usp-section {
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    padding: 5rem 2rem;
    margin-top: 4rem;
}

.usp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
}

.usp-item {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.usp-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.usp-item i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.usp-item h4 {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 80px 0 40px;
    margin-top: 6rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer h4 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer p {
    opacity: 0.7;
    margin-bottom: 0.8rem;
}

.subscribe-form {
    display: flex;
    margin-top: 1.5rem;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    gap: 0.5rem;
}

.subscribe-form input {
    background: transparent;
    border: none;
    padding: 0.8rem;
    color: var(--white);
    flex: 1;
    min-width: 0;
    outline: none;
}

.btn-join {
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    padding: 0.8rem 1rem;
    border-radius: calc(var(--radius-md) - 4px);
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-join:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .subscribe-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-join {
        width: 100%;
        padding: 0.8rem;
    }
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.5rem;
    opacity: 0.7;
}

.social-links a:hover {
    opacity: 1;
    color: var(--accent);
}

/* Chat Page Specifics */
.chat-container-modern {
    max-width: 900px;
    height: 80vh;
    margin: 120px auto 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none; /* Add hamburger menu logic later if needed */
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary);
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-group input, 
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-alt);
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(42, 65, 40, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* About Page Styles */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    max-width: 600px;
}

.about-image img {
    width: 100%;
    height: auto;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    padding: 0 20px;
}

.value-item {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.value-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.value-item i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.value-item h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.value-item p {
    color: var(--text-muted);
    line-height: 1.6;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.team-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.team-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--accent);
}

.team-card h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.team-card .role {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.team-card p:not(.role) {
    color: var(--text-muted);
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.stat-item p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.contact-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.contact-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.contact-card h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-image {
        order: -1;
    }
}
