/* ============================================
   BagBurg — Кожевенная мастерская Александра Рудковского
   Все стили локальны, без CDN
   ============================================ */

/* ============================================
   ЛОКАЛЬНЫЕ ШРИФТЫ
   ============================================ */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Inter-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/Inter-500.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/Inter-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Inter-700.ttf') format('truetype');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/PlayfairDisplay-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/PlayfairDisplay-700.ttf') format('truetype');
}

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

:root {
    --bg-primary: #F0EBE3;
    --bg-secondary: #E6DFD5;
    --bg-card: #F7F4F0;
    --text-primary: #1A1512;
    --text-secondary: #5C5048;
    --accent: #5C4033;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(26, 21, 18, 0.03);
    --shadow-hover: 0 8px 30px rgba(26, 21, 18, 0.08);
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER
   ============================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(240, 235, 227, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(92, 64, 51, 0.08);
    z-index: 100;
    padding: 1.2rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    gap: 2.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--accent);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

.header-contact {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-small {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ============================================
   БУРГЕР
   ============================================ */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 110;
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    margin-top: 72px;
    padding: 8rem 2rem 6rem;
    text-align: center;
    background: var(--bg-primary);
    position: relative;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.brand-name {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    line-height: 1;
}

.brand-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.brand-tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-style: italic;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ============================================
   SECTIONS
   ============================================ */
section {
    padding: 6rem 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.process-phone {
    font-size: 1.15rem;
    margin-top: 0.3rem;
}

.process-phone a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.process-phone a:hover {
    border-bottom: 1px solid var(--accent);
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   PRODUCTS
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    transition: all 0.4s ease;
    border: 1px solid rgba(92, 64, 51, 0.08);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.product-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.product-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.product-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.product-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery {
    background: var(--bg-secondary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 320px;
    grid-auto-flow: dense;
    gap: 1.25rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-card);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 21, 18, 0.7) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-view-text {
    color: var(--bg-primary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--bg-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
}

.gallery-counter {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

.gallery-counter a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.gallery-counter a:hover {
    border-bottom-color: var(--accent);
}

/* ============================================
   PROCESS
   ============================================ */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.process-step {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid rgba(92, 64, 51, 0.08);
    transition: all 0.4s ease;
}

.process-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.step-number {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 1rem;
    font-weight: 700;
}

.process-step h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.process-step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   CONTACTS
   ============================================ */
.contacts {
    background: var(--bg-secondary);
    text-align: center;
}

.btn-order {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    padding: 1.2rem 3rem;
}

.contact-phone {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text-primary);
    margin: 2rem 0;
    display: inline-block;
    transition: color 0.3s ease;
    text-decoration: none;
}

.contact-phone:hover {
    color: var(--accent);
}

.contact-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.delivery-info {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.delivery-info h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.delivery-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--bg-primary);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(92, 64, 51, 0.08);
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(26, 21, 18, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 2rem;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(240, 235, 227, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: rgba(240, 235, 227, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(240, 235, 227, 0.2);
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(240, 235, 227, 0.2);
    transform: rotate(90deg);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    color: var(--bg-primary);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(240, 235, 227, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(240, 235, 227, 0.2);
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(240, 235, 227, 0.2);
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    color: var(--bg-primary);
}

.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

/* ============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ
   ============================================ */
.anim {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (prefers-reduced-motion: reduce) {
    .anim {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   КНОПКА «НАВЕРХ»
   ============================================ */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-hover);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(26, 21, 18, 0.15);
}

#backToTop svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .burger {
        display: flex;
    }

    .btn-small {
        display: none;
    }

    header nav {
        display: flex;
        position: fixed;
        inset: 0;
        background: rgba(240, 235, 227, 0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        z-index: 105;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    header nav.open {
        opacity: 1;
        visibility: visible;
    }

    header nav a {
        font-size: 1.4rem;
    }

    .no-scroll {
        overflow: hidden;
    }

    .hero {
        padding: 6rem 1.5rem 4rem;
    }

    section {
        padding: 4rem 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 280px;
    }

    .gallery-item.wide { grid-column: span 1; }

    .products-grid,
    .process-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev { left: 1rem; }
    .lightbox-next { right: 1rem; }
}
