/* =========================================
   1. ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
   ========================================= */
:root {
    --color-bg: #FAFAFA;
    --color-surface: #FFFFFF;
    --color-primary: #1A1A1A;
    --color-accent: #ffb700; /* Тёмное золото */
    --color-accent-hover: #ffbc14;
    --color-text: #2C2C2C;
    --color-text-muted: #6B7280;
    --color-success: #059669;
    --color-sold: #DC2626;
    --color-reserved: #D97706;
    
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
    
    --blur: blur(12px);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: none;}
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; }
a { text-decoration: none; color: inherit; }

/* =========================================
   2. НАВИГАЦИЯ
   ========================================= */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 20px 0; transition: var(--transition);
}
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-family: var(--font-heading); font-size: 1.6rem; font-weight: 600;
    color: var(--color-surface); letter-spacing: 3px; transition: var(--transition);
}
.navbar.scrolled .logo { color: var(--color-primary); }

.nav-links { display: flex; list-style: none; gap: 32px; }
.nav-links a {
    color: rgba(255,255,255,0.9); font-size: 0.9rem;
    letter-spacing: 1px; transition: var(--transition); position: relative;
}
.navbar.scrolled .nav-links a { color: var(--color-text); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1.5px;
    background: var(--color-accent); transition: var(--transition);
}
.nav-links a:hover::after { width: 100%; }

/* =========================================
   3. HERO СЕКЦИЯ
   ========================================= */
.hero {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: url('/static/paintings/artist.jpg') center/cover;
    opacity: 0.4;
}
.hero-content { position: relative; z-index: 1; color: white; padding: 0 24px; }
.hero h1 { font-size: clamp(3rem, 8vw, 5.5rem); letter-spacing: 8px; margin-bottom: 16px; animation: fadeInUp 1s ease; }
.subtitle { font-size: 1.2rem; letter-spacing: 6px; text-transform: uppercase; opacity: 0.9; margin-bottom: 40px; animation: fadeInUp 1s ease 0.2s both; }

/* =========================================
   4. КНОПКИ
   ========================================= */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; background: var(--color-accent); color: white;
    border-radius: 50px; font-size: 0.9rem; letter-spacing: 1.5px;
    border: none; cursor: pointer; transition: var(--transition);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}
.btn-primary:hover {
    background: var(--color-accent-hover); transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.4);
}
.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; background: transparent; color: var(--color-primary);
    border: 1.5px solid var(--color-primary); border-radius: 50px;
    font-size: 0.85rem; letter-spacing: 1px; transition: var(--transition);
}
.btn-secondary:hover { background: var(--color-primary); color: white; }

/* =========================================
   5. ОБЩИЕ СЕКЦИИ
   ========================================= */
.section { padding: 100px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section-title {
    font-size: clamp(2rem, 5vw, 3rem); text-align: center; margin-bottom: 60px;
    letter-spacing: 2px; position: relative;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 2px;
    background: var(--color-accent); margin: 20px auto 0;
}

/* =========================================
   6. КАТАЛОГ
   ========================================= */
.series-block { margin-bottom: 80px; }
.series-title {
    font-size: 1.8rem; margin-bottom: 32px; padding-left: 16px;
    border-left: 3px solid var(--color-accent); letter-spacing: 1px;
}
.paintings-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px;
}
.painting-card {
    background: var(--color-surface); border-radius: var(--radius-md);
    overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.painting-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.card-image { 
    position: relative; 
    aspect-ratio: 4/5; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Сохраняет скругления углов карточки */
}
.card-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* Показывает картинку целиком, не обрезая края */
    transition: transform 0.6s ease; 
}
.painting-card:hover .card-image img { transform: scale(1.05); }
.card-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px); display: flex; align-items: center;
    justify-content: center; opacity: 0; transition: var(--transition);
}
.painting-card:hover .card-overlay { opacity: 1; }
.card-info { padding: 24px; }
.painting-title { font-size: 1.4rem; margin-bottom: 8px; }
.painting-meta { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 16px; }
.painting-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 16px; border-top: 1px solid rgba(0,0,0,0.06);
}
.painting-price { font-size: 1.2rem; font-weight: 600; color: var(--color-accent); }

/* Статусы */
.painting-status {
    font-size: 0.8rem; padding: 4px 12px; border-radius: 20px; font-weight: 500; letter-spacing: 0.5px;
}
.status-available { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.status-sold { background: rgba(239, 68, 68, 0.1); color: var(--color-sold); }
.status-reserved { background: rgba(245, 158, 11, 0.1); color: var(--color-reserved); }

/* =========================================
   7. СТРАНИЦА КАРТИНЫ (DETAIL)
   ========================================= */
.detail-section { padding: 120px 0 80px; background: var(--color-bg); }
.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start;
}
.detail-image {
    border-radius: var(--radius-md); 
    overflow: hidden; 
    box-shadow: var(--shadow-lg);
    background-color: #f7faff; /* Серый фон на всякий случай */
}
.detail-image img { width: 100%; height: auto; display: block; }
.detail-info {
    background: var(--color-surface); padding: 40px; border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
.detail-series {
    color: var(--color-accent); font-size: 1rem; letter-spacing: 2px;
    text-transform: uppercase; margin-bottom: 8px;
}
.detail-title { font-size: 2.5rem; margin-bottom: 24px; line-height: 1.2; }
.detail-desc {
    font-size: 1.05rem; color: var(--color-text-muted); line-height: 1.8; margin-bottom: 32px;
}
.specs-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    padding: 24px 0; border-top: 1px solid rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 32px;
}
.spec-item { display: flex; flex-direction: column; gap: 4px; }
.spec-label { font-size: 0.85rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.spec-value { font-size: 1.1rem; font-weight: 500; }
.detail-price { font-size: 2rem; font-weight: 600; color: var(--color-accent); margin-bottom: 32px; }
.back-link {
    display: inline-flex; align-items: center; gap: 8px; color: var(--color-text-muted);
    margin-bottom: 24px; transition: var(--transition);
}
.back-link:hover { color: var(--color-accent); }

/* =========================================
   8. ПРОВЕРКА ПОДЛИННОСТИ И КОНТАКТЫ
   ========================================= */
.verify-box {
    max-width: 600px; margin: 0 auto; background: var(--color-surface);
    padding: 48px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    text-align: center; border: 1px solid rgba(0,0,0,0.04);
}
.verify-form { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.verify-form input {
    flex: 1; min-width: 250px; padding: 14px 20px; border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-sm); font-size: 1rem; outline: none; transition: var(--transition);
}
.verify-form input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1); }

.contact-content { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: start; }
.contact-info h3 { font-size: 1.8rem; margin-bottom: 16px; }
.contact-list { list-style: none; margin-top: 24px; }
.contact-list li {
    display: flex; align-items: center; gap: 12px; padding: 12px 0;
    font-size: 1.05rem; color: var(--color-text-muted);
}
.contact-list a { color: var(--color-accent); transition: var(--transition); }
.contact-list a:hover { color: var(--color-accent-hover); text-decoration: underline; }
.location-icon { width: 20px; height: 20px; stroke: var(--color-accent); }

.contact-form {
    background: var(--color-surface); padding: 40px; border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
.form-group { margin-bottom: 20px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 14px 18px; border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-sm); font-size: 1rem; outline: none;
    transition: var(--transition); font-family: var(--font-body);
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* =========================================
   9. ФУТЕР И АНИМАЦИИ
   ========================================= */
.footer { background: var(--color-primary); color: rgba(255,255,255,0.7); text-align: center; padding: 60px 0; }
.footer p { margin-bottom: 8px; letter-spacing: 1px; }

/* =========================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   ========================================= */

/* Кнопка Купить */
.btn-buy {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; background: var(--color-success); color: white;
    border-radius: 20px; font-size: 0.8rem; font-weight: 500;
    transition: var(--transition); text-decoration: none;
}
.btn-buy:hover {
    background: #047857; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Бейдж скидки */
.discount-badge {
    position: absolute; top: 12px; right: 12px;
    background: var(--color-sold); color: white;
    padding: 6px 12px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600;
    z-index: 2;
}
.discount-badge-large {
    position: absolute; top: 20px; right: 20px;
    background: var(--color-sold); color: white;
    padding: 12px 24px; border-radius: 30px;
    font-size: 1.1rem; font-weight: 600;
    z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Старая цена */
.painting-price-old {
    font-size: 0.95rem; color: var(--color-text-muted);
    text-decoration: line-through; margin-right: 8px;
}
.price-block { display: flex; align-items: center; }
.action-buttons { display: flex; gap: 8px; align-items: center; }

.price-section { text-align: center; margin: 24px 0; }
.price-old {
    font-size: 1.5rem; color: var(--color-text-muted);
    text-decoration: line-through; margin-bottom: 8px;
}
.discount-info {
    font-size: 0.95rem; color: var(--color-success);
    margin-top: 8px; font-weight: 500;
}

/* =========================================
   СЕКЦИЯ "О ХУДОЖНИКЕ"
   ========================================= */
.about-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 60px;
    align-items: start;
    max-width: 1500px;
    margin: 0 auto;
}
.about-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.about-image img {
    width: 100%;
    height: auto;
    display: block;
}
.about-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--color-text);
}
.about-intro {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 24px;
    line-height: 1.7;
}
.about-text p {
    margin-bottom: 20px;
}
.about-signature {
    margin-top: 32px;
    font-style: italic;
    color: var(--color-text-muted);
}
.about-signature strong {
    font-size: 1.3rem;
    color: var(--color-accent);
    font-style: normal;
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* =========================================
   КНОПКИ СТАТУСОВ
   ========================================= */
.btn-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.btn-buy {
    background: var(--color-success);
    color: white;
}
.btn-buy:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-reserved {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-reserved);
    cursor: default;
}

.btn-sold {
    background: rgba(220, 38, 38, 0.15);
    color: var(--color-sold);
    cursor: default;
}

/* Адаптивность для кнопок */
@media (max-width: 640px) {
    .painting-footer {
        flex-direction: column; align-items: flex-start; gap: 12px;
    }
    .action-buttons { width: 100%; justify-content: space-between; }
    .btn-buy { flex: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* =========================================
   10. АДАПТИВНОСТЬ
   ========================================= */
@media (max-width: 968px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-title { font-size: 2rem; }
}
@media (max-width: 768px) {
    .nav-links { display: none; } /* Для простоты на мобильном скрываем, можно добавить бургер */
    .contact-content { grid-template-columns: 1fr; }
    .hero h1 { letter-spacing: 4px; }
    .verify-form { flex-direction: column; }
    .verify-form input { min-width: 100%; }
}