:root {
    /* Цвета — светлый крафт */
    --bg: #FAFAF8;
    --bg-warm: #f5f5f0;
    --card: #FFFFFF;
    --text: #1a1a1a;
    --text-light: #666666;
    --text-muted: #999999;
    --primary: #8BC34A;
    --primary-dark: #689F38;
    --primary-light: #DCEDC8;
    --accent: #FF9800;
    --accent-light: #FFE0B2;
    --border: #E8E8E8;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(250,250,248,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.logo span { color: var(--primary); }
.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}
.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    position: relative;
}
.nav a:hover { color: var(--primary); }
.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}
.nav a:hover::after { width: 100%; }

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

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139,195,74,0.3);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-ghost {
    background: transparent;
    color: var(--text-light);
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--primary); }

/* Hero */
.hero {
    background: linear-gradient(135deg, #f8f9f5 0%, #e8f5e0 50%, #f0f5e8 100%);
    padding: 80px 24px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,195,74,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero-content h1 {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text);
}
.hero-content h1 span { color: var(--primary); font-style: italic; }
.hero-content p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 32px;
    max-width: 480px;
}
.hero-badges {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.badge {
    background: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    border: 1px solid var(--border);
}
.badge-accent {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}
.hero-cta {
    display: flex;
    gap: 16px;
}
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15));
}

/* Section */
.section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px;
}
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 12px;
}
.section-title span { color: var(--primary); }
.section-subtitle {
    color: var(--text-light);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Brands */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.brand-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.brand-card img {
    height: 80px;
    width: auto;
    margin-bottom: 16px;
    object-fit: contain;
}
.brand-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}
.brand-card p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}
.brand-count {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.product-image {
    height: 260px;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s;
}
.product-card:hover .product-image img {
    transform: scale(1.08);
}
.product-info {
    padding: 20px;
}
.product-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 8px;
}
.product-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.meta-tag {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 4px;
}
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.product-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}
.product-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}
.btn-add {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}
.btn-add:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Filters */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}
.filter-tag {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-light);
}
.filter-tag:hover, .filter-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 24px;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: white;
    border-radius: var(--radius);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}
.modal-overlay.active .modal {
    transform: scale(1);
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.modal-close:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
}
.modal-image {
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.modal-image img {
    max-height: 400px;
    max-width: 100%;
    object-fit: contain;
}
.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
}
.modal-brand {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 12px;
}
.modal-name {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}
.modal-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}
.meta-item {
    text-align: center;
}
.meta-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}
.meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.modal-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 32px;
    flex: 1;
}
.modal-price {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 24px;
}
.modal-actions {
    display: flex;
    gap: 12px;
}
.modal-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 14px 24px;
}

/* About */
.about-section {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.about-text h2 {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}
.about-text h2 span { color: var(--primary); }
.about-text p {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.8;
}
.about-stats {
    display: flex;
    gap: 48px;
    margin-top: 40px;
}
.stat {
    text-align: center;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Gallery scroll */
.gallery-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 24px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.gallery-scroll::-webkit-scrollbar { height: 4px; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }
.gallery-item {
    flex-shrink: 0;
    width: 300px;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    scroll-snap-align: start;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery-item:hover img {
    transform: scale(1.05);
}

/* Footer */
.footer {
    background: var(--text);
    color: white;
    padding: 80px 24px 40px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}
.footer-block h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
    color: var(--primary);
}
.footer-block a, .footer-block p {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    line-height: 2.4;
    display: block;
    transition: var(--transition);
}
.footer-block a:hover { color: white; }
.footer-bottom {
    max-width: 1280px;
    margin: 60px auto 0;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-bottom p {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

/* Mobile */
@media (max-width: 768px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-content h1 { font-size: 36px; }
    .hero-image { display: none; }
    .brands-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .modal-content { grid-template-columns: 1fr; }
    .nav { display: none; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .section { padding: 60px 16px; }
    .about-stats { gap: 24px; }
    .stat-value { font-size: 36px; }
    
    /* Modal fixes for tablet */
    .modal-overlay { 
        padding: 0; 
        align-items: stretch;
    }
    .modal { 
        max-width: 100%; 
        width: 100%; 
        margin: 0; 
        max-height: 100vh;
        border-radius: 0;
    }
    .modal-image { padding: 24px; }
    .modal-image img { max-height: 250px; }
    .modal-info { padding: 24px; }
    
    /* Header */
    .header-inner { padding: 12px 16px; gap: 12px; }
    .logo { font-size: 22px; }
    .header-actions { gap: 8px; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .brands-grid { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 28px; }
    .section-title { font-size: 28px; }
    
    /* Modal fixes for mobile */
    .modal-overlay { padding: 0; }
    .modal { 
        margin: 0; 
        border-radius: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }
    .modal-image { padding: 16px; }
    .modal-image img { max-height: 200px; }
    .modal-info { padding: 16px; }
    .modal-close { 
        top: 8px; 
        right: 8px; 
        width: 36px; 
        height: 36px; 
        font-size: 18px; 
    }
    
    /* Header */
    .header-inner { 
        padding: 10px 12px; 
        gap: 8px;
        flex-wrap: nowrap;
    }
    .logo { font-size: 20px; }
    .header-actions { 
        gap: 6px; 
        flex-wrap: nowrap;
    }
}

/* Auth container fix */
#auth-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
#auth-container .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
