/* =========================================
   ОБЩИЕ СТИЛИ — style.css
   ========================================= */

/* 🔹 Reset & Box Sizing */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 🔹 CSS Variables */
:root {
    --color-terracotta: #A0522D;
    --color-brown: #8B4513;
    --color-sage: #556B2F;
    --color-beige: #FDFBF7;
    --color-cream: #F5F0E8;
    --color-text: #3D3630;
    --color-text-light: #6B6258;
    --color-white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: 250ms ease-out;
    --transition-normal: 400ms ease-out;
    --transition-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🔹 Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--color-beige);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: url("image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4c4b0' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

:focus-visible {
    outline: 3px solid var(--color-sage);
    outline-offset: 2px;
}

a:focus-visible {
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   HEADER & LOGO (В ОДНУ СТРОКУ)
   ========================================= */
header {
    text-align: center;
    padding: 40px 20px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.workshop-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-terracotta);
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.tagline {
    font-size: 0.95rem;
    color: var(--color-brown);
    font-weight: 500;
    margin: 4px 0 0;
    opacity: 0.9;
}

/* =========================================
   SOCIAL BUTTONS
   ========================================= */
.social-section {
    margin: 30px 0;
    scroll-margin-top: 20px;
}

.section-intro {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: var(--color-text);
    font-style: italic;
    opacity: 0.95;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.social-row {
    display: flex;
    gap: 14px;
    width: 100%;
}

.social-row .social-btn {
    flex: 1;
    min-width: 0;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--color-white);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--color-terracotta);
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(160, 82, 45, 0.08));
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.social-btn:hover::before {
    opacity: 1;
}

.social-btn:hover {
    border-color: var(--color-brown);
    background: rgba(245, 240, 232, 0.6);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.social-btn svg {
    width: 24px;
    height: 24px;
    margin-bottom: 6px;
    flex-shrink: 0;
    display: block;
}

.social-btn span {
    display: inline-block;
}

.btn-subtitle {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-text-light);
    margin-top: 4px;
    line-height: 1.3;
    opacity: 0.9;
}

/* =========================================
   DIVIDER
   ========================================= */
.divider {
    text-align: center;
    margin: 40px 0;
    font-size: 1.3rem;
    color: var(--color-terracotta);
    opacity: 0.5;
    letter-spacing: 8px;
    user-select: none;
}

/* =========================================
   SECTIONS COMMON
   ========================================= */
.about-section, .order-section {
    margin: 50px 0;
    padding: 40px 30px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-cream);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.about-section:hover, .order-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--color-terracotta);
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--color-terracotta);
    opacity: 0.4;
}

/* =========================================
   ABOUT SECTION
   ========================================= */
.photo-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 25px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--color-cream);
    background: var(--color-cream);
    transition: transform var(--transition-normal);
}

.photo-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-slow);
}

.photo-container:hover img {
    transform: scale(1.02);
}

.about-text {
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: center;
    color: var(--color-text);
}

.about-text p {
    margin-bottom: 15px;
}

/* =========================================
   PRODUCTS & GALLERY LINKS (КАРТОЧКИ = ССЫЛКИ)
   ========================================= */
.products-section {
    margin: 50px 0;
}

.products-grid {
    display: grid;
    gap: 20px;
}

.product-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-cream);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(160, 82, 45, 0.3);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--color-cream);
    display: block;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--color-terracotta);
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-description {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.6;
    flex-grow: 1;
}

/* =========================================
   ORDER SECTION
   ========================================= */
.order-section {
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-beige) 100%);
    border: 2px dashed var(--color-terracotta);
    position: relative;
    overflow: hidden;
}

.order-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 82, 45, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.order-steps {
    margin-top: 25px;
}

.order-step {
    margin-bottom: 22px;
    padding-left: 18px;
    border-left: 3px solid var(--color-terracotta);
    position: relative;
    transition: transform var(--transition-fast);
}

.order-step:hover {
    transform: translateX(3px);
}

.order-step strong {
    color: var(--color-brown);
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
    font-weight: 600;
}

.order-note {
    margin-top: 28px;
    padding: 16px 20px;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    color: var(--color-brown);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--color-sage);
    transition: transform var(--transition-fast);
}

.order-note:hover {
    transform: scale(1.01);
}

/* =========================================
   CTA BUTTONS
   ========================================= */
.cta-container {
    text-align: center;
    margin: 35px 0 20px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--color-terracotta);
    color: var(--color-white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--color-brown);
    cursor: pointer;
}

.cta-btn:hover {
    background: var(--color-brown);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-btn:active {
    transform: translateY(0);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 40px 20px 60px;
    margin-top: 50px;
    border-top: 1px solid var(--color-cream);
    color: var(--color-brown);
    font-size: 0.9rem;
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

footer:hover {
    opacity: 1;
}

.footer-heart {
    color: var(--color-terracotta);
    font-size: 1.3rem;
    margin: 10px 0;
    display: inline-block;
    animation: heartbeat 2.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.05); }
    20% { transform: scale(1); }
    30% { transform: scale(1.03); }
    40% { transform: scale(1); }
}

footer p {
    margin: 4px 0;
}

/* =========================================
   GALLERY PAGE SPECIFIC
   ========================================= */

/* 🔹 Навигация галереи — ЕДИНАЯ ВЫСОТА КНОПОК */
.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center; /* 🔹 Выравниваем все кнопки по центру по вертикали */
    gap: 12px;
    margin: 20px 0 30px;
    position: sticky;
    top: 10px;
    z-index: 100;
    background: var(--color-beige);
    padding: 15px 0;
    border-bottom: 1px solid var(--color-cream);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 🔹 ОБЩИЕ СТИЛИ для ВСЕХ кнопок навигации (одинаковая высота!) */
.gallery-nav-btn,
.gallery-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;              /* 🔹 Фиксированная высота для всех */
    padding: 0 16px;           /* 🔹 Только горизонтальные отступы */
    background: var(--color-white);
    border: 2px solid var(--color-cream);
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    box-sizing: border-box;    /* 🔹 Границы не увеличивают высоту */
    flex-shrink: 0;
    white-space: nowrap;
}

/* 🔹 Специфика для текстовых кнопок разделов */
.gallery-nav-btn {
    gap: 8px;
}

/* 🔹 Специфика для кнопки "Домой" */
.gallery-home-btn {
    width: 48px;               /* 🔹 Квадратная форма */
    padding: 0;                /* 🔹 Без отступов для идеального центра */
    font-size: 1.4rem;         /* 🔹 Размер emoji */
    line-height: 1;
}

/* 🔹 Ховер-эффекты для всех кнопок */
.gallery-nav-btn:hover,
.gallery-home-btn:hover {
    border-color: var(--color-terracotta);
    background: var(--color-cream);
    transform: translateY(-2px);
}

/* 🔹 Активное состояние */
.gallery-nav-btn.active {
    background: var(--color-terracotta);
    color: var(--color-white);
    border-color: var(--color-brown);
}

.gallery-nav-btn.active:hover {
    transform: none;
    background: var(--color-brown);
}

/* 🔹 Иконки и счётчики */
.gallery-nav-icon {
    font-size: 1.2rem;
}

.gallery-nav-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.gallery-nav-btn.active .gallery-nav-count {
    background: rgba(255,255,255,0.2);
}

/* 🔹 Остальные стили галереи (без изменений) */
.gallery-content {
    margin-bottom: 60px;
}

.gallery-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.gallery-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-description {
    font-size: 1rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: 5px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    background: var(--color-cream);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(160, 82, 45, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-zoom {
    font-size: 2.5rem;
    color: white;
    transform: scale(0.8);
    transition: transform var(--transition-fast);
}

.gallery-item:hover .gallery-zoom {
    transform: scale(1);
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-cream);
    color: var(--color-text-light);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(61, 54, 48, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 2rem;
    width: 45px;
    height: 45px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    max-width: 80%;
    backdrop-filter: blur(4px);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 20px;
    color: var(--color-terracotta);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.back-link:hover {
    background: rgba(160, 82, 45, 0.1);
    transform: translateX(-3px);
}

/* Print Styles */
@media print {
    body { background: white; color: black; font-size: 11pt; }
    .social-btn, .product-card, .order-section { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .social-btn:hover, .product-card:hover { transform: none; }
    a { text-decoration: none; color: black; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #666; }
    .no-print, .gallery-nav, .lightbox { display: none !important; }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
    }
    .header-text {
        align-items: center;
        text-align: center;
    }
    .workshop-name { font-size: 1.8rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .gallery-nav { flex-wrap: wrap; top: 0; padding: 10px 0; }
    .gallery-nav-btn { font-size: 0.85rem; padding: 8px 15px; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.8rem; }
    .gallery-nav-btn { flex: 1; min-width: calc(50% - 6px); justify-content: center; }
    .social-btn { padding: 12px 8px; font-size: 0.85rem; }
    .btn-subtitle { font-size: 0.65rem; }
    .social-row { gap: 8px; }
    .about-section, .order-section { padding: 30px 20px; }
    .product-image { height: 200px; }
}

@media (max-width: 360px) {
    .social-row { flex-direction: column; }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

header, .social-section, .about-section, .products-section, .order-section, footer, .gallery-wrapper {
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 0.1s;
}
.social-section { animation-delay: 0.25s; }
.about-section { animation-delay: 0.4s; }
.products-section { animation-delay: 0.55s; }
.order-section { animation-delay: 0.7s; }
footer { animation-delay: 0.85s; }
