/*
Theme Name: Art AK Theme
Author: You
Version: 1.1
Description: Minimalistic black & white theme with full-width layout
*/

/* === Основные стили === */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    color: #222;
    background: #fff;
    padding-top: 68px !important; /* Новое значение отступа */
    display: flex;
    flex-direction: column;
    min-height: 100vh;    
}

/* === ОСНОВНОЙ КОНТЕНТ === */
.content {
    width: 100%;
    flex: 1;
    box-sizing: border-box;
    position: relative;
}

/* Современные шрифты */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* === ШАПКА (ИСПРАВЛЕННАЯ ВЕРСИЯ) === */
.site-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
    padding: 15px 0;
    height: auto;
    box-sizing: border-box;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 5%;
    height: 100%;
    box-sizing: border-box;
}

.logo {
    opacity: 1;
    z-index: 1001;
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    margin: 0;
    color: #000;
    letter-spacing: 1px;
    font-weight: 600;
    line-height: 1.2;
}

.logo p {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    margin: 3px 0 0;
    color: #555;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.main-menu .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
}

.main-menu .menu li {
    position: relative;
}

.main-menu .menu a {
    display: inline-block;
    padding: 12px 25px;
    background: transparent;
    color: #000;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.4s ease;
    border-radius: 0;
    border: 1px solid transparent;
    position: relative;
}

.main-menu .menu a:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.03);
}

.main-menu .menu a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 1px;
    background: #000;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-menu .menu a:hover::after {
    width: 70%;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #000;
    font-size: 24px;
    color: #000;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.4s ease;
    z-index: 1001;
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    outline: none !important;
    box-shadow: none !important;
}

.menu-toggle:focus {
    outline: none;
    box-shadow: none;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.menu-toggle.active {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
    border-color: #000;
}

@media (max-width: 992px) {
    .main-menu .menu {
        gap: 8px;
    }
    
    .main-menu .menu a {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    body {
        padding-top: 70px;
    }
    
    .site-header-fixed {
        height: 70px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-menu .menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.93);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        box-shadow: -5px 0 25px rgba(0,0,0,0.08);
        padding: 80px 20px 20px;
    }
    
    .main-menu .menu.active {
        right: 0;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .logo p {
        font-size: 12px;
    }
    
    body {
        padding-top: 60px;
    }
    
    .site-header-fixed {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .main-menu .menu {
        width: 85%;
    }
    
    .header-container {
        padding: 0 4%;
    }
    
    .logo h1 {
        font-size: 22px;
    }
}

/* === ФУТЕР === */
.footer {
    background-color: rgba(0, 0, 0, 0.92); 
    color: #fff;
    padding: 25px 5%;
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: center;
}

.footer-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-icon:hover::before {
    opacity: 1;
}

.social-icon svg {
    width: 50%;
    height: 50%;
    transition: transform 0.3s ease;
}

.social-icon:hover svg {
    transform: scale(1.1);
}

.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.telegram {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
}

.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.vk {
    background: linear-gradient(135deg, #4C75A3, #2A5885);
}

.social-icon svg path {
    fill: #fff;
}

.footer-copyright {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.4px;
    opacity: 0.85;
    white-space: nowrap;
}

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

@media (max-width: 768px) {
    .footer {
        padding: 20px 4%;
    }
    
    .footer-center {
        gap: 20px;
    }
    
    .footer-social {
        gap: 12px;
    }
    
    .social-icon {
        width: 26px;
        height: 26px;
    }
    
    .footer-copyright {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .footer-center {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-social {
        gap: 10px;
    }
    
    .social-icon {
        width: 24px;
        height: 24px;
    }
    
    .footer-copyright {
        font-size: 10px;
        order: -1;
    }
}

@media (max-width: 360px) {
    .footer-social {
        gap: 8px;
    }
    
    .social-icon {
        width: 22px;
        height: 22px;
    }
    
    .footer-copyright {
        font-size: 9px;
    }
}

/* === Hero раздел === */
.hero {
    position: relative;
    height: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    margin: 0;
    background: #000;
    z-index: 1;
    box-sizing: border-box;
    padding-bottom: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(30,30,30,0.8) 0%, rgba(0,0,0,1) 70%);
    z-index: 2;
}

.hero-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 5%;
    z-index: 5;
}

.hero-paint-stroke {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    opacity: 0.15;
    filter: blur(1px);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 40"><path d="M0,20 Q50,0 100,20 T200,20" fill="none" stroke="black" stroke-width="8"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 40"><path d="M0,20 Q50,0 100,20 T200,20" fill="none" stroke="black" stroke-width="8"/></svg>');
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.hero-paint-stroke-1 {
    width: 600px;
    height: 120px;
    top: 15%;
    right: 10%;
    transform: rotate(15deg);
    background: linear-gradient(45deg, #8A2BE2, #1E90FF);
}

.hero-paint-stroke-2 {
    width: 400px;
    height: 80px;
    bottom: 25%;
    right: 20%;
    transform: rotate(-10deg);
    background: linear-gradient(45deg, #FF6347, #FFD700);
}

.hero-paint-stroke-3 {
    width: 300px;
    height: 60px;
    top: 40%;
    right: 15%;
    transform: rotate(5deg);
    background: linear-gradient(45deg, #32CD32, #00BFFF);
}

.hero-paint-splatter {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(2px);
}

.hero-splatter-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    right: 25%;
    background: radial-gradient(circle, #FF1493, transparent 70%);
}

.hero-splatter-2 {
    width: 120px;
    height: 120px;
    bottom: 30%;
    right: 15%;
    background: radial-gradient(circle, #FF4500, transparent 70%);
}

.hero-splatter-3 {
    width: 60px;
    height: 60px;
    top: 45%;
    right: 30%;
    background: radial-gradient(circle, #9370DB, transparent 70%);
}

.hero-canvas-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: 
        radial-gradient(circle at 90% 20%, rgba(50,50,50,0.1) 0%, transparent 2%),
        radial-gradient(circle at 70% 80%, rgba(40,40,40,0.1) 0%, transparent 3%),
        radial-gradient(circle at 30% 40%, rgba(60,60,60,0.1) 0%, transparent 2%);
    background-size: 500px 500px;
    background-repeat: no-repeat;
}

.hero-text {
    max-width: 650px;
    color: #fff;
    position: relative;
    z-index: 4;
    padding-right: 40px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 30px 0;
    letter-spacing: -1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 
                 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.5), transparent);
    opacity: 0.7;
}

.hero-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.35rem;
    font-weight: 300;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 0 40px 0;
    opacity: 0.9;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 42px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 3;
}

.hero-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgb(255, 255, 255));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-button:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.hero-button:hover::before {
    opacity: 1;
}

.hero-button:hover svg path {
    stroke: #000;
}

.hero-button svg {
    transition: transform 0.3s ease;
}

.hero-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.hero-button:hover svg {
    transform: translateX(5px);
}

.hero-image {
    flex: 0 0 auto;
    max-width: 50%;
}

.hero-img {
    width: auto;
    height: auto;
    max-height: 65vh;
    max-width: 90%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    z-index: 6;
    position: relative;
}

.hero-scroll {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 6;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    opacity: 0.85;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.scroll-indicator {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.scroll-indicator span {
    display: block;
    width: 4px;
    height: 20px;
    background: #fff;
    animation: bounce 1.8s infinite ease-in-out;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Адаптивность */
@media (max-width: 1400px) {
    .hero-title {
        font-size: 3.8rem;
    }
    
    .hero-paint-stroke-1 {
        width: 500px;
        right: 5%;
    }
    
    .hero-paint-stroke-2 {
        width: 350px;
    }
}

@media (max-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero {
        min-height: 650px;
    }
    
    .hero-paint-stroke-1 {
        width: 400px;
        top: 10%;
    }
    
    .hero-paint-stroke-2 {
        width: 300px;
        bottom: 20%;
    }
    
    .hero-paint-stroke-3 {
        width: 250px;
    }
}

/* Основные исправления для мобильных */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding-top: 40px;
        align-items: center;
    }
    
    .hero-text {
        max-width: 100%;
        margin-bottom: 40px;
        padding: 0 20px;
    }
    
    .hero-subtitle {
        margin: 0 auto 40px;
        max-width: 90%;
    }
    
    .hero-image {
        width: 100%;
        max-width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }
    
    .hero-img {
        max-height: 55vh; /* Увеличен размер изображения */
        width: 100%;
        object-fit: contain;
        margin: 0 auto 40px;
    }
    
    .hero-scroll {
        position: relative;
        margin-top: 20px;
        margin-bottom: 30px;
        bottom: auto;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 0 !important; /* Убрали белый отступ */
        min-height: 90vh;
    }
    
    .hero-content {
        padding-top: 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 20px;
    }
    
    .hero-subtitle {
        font-size: 1.05rem;
        margin-bottom: 30px;
    }
    
    .hero-button {
        padding: 14px 30px;
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .hero-img {
        max-height: 45vh; /* Увеличен размер изображения */
    }
}

@media (max-width: 576px) {
    .hero {
        padding-bottom: 60px;
        min-height: 85vh;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        max-width: 95%;
    }
    
    .hero-img {
        max-height: 40vh; /* Увеличен размер изображения */
        margin-bottom: 30px;
    }
    
    .hero-scroll {
        margin-top: 10px;
        margin-bottom: 20px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-button {
        padding: 12px 25px;
        font-size: 0.85rem;
    }
    
    .hero-img {
        max-height: 40vh; /* Максимально увеличен размер */
    }
}

/* Исправление для шапки */
@media (max-width: 768px) {
    .site-header-fixed {
        height: 60px;
        padding: 10px 0;
    }
    
    body {
        padding-top: 60px !important;
    }
    
    .logo h1 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .logo p {
        font-size: 0.7rem;
    }
}

.site-header-fixed {
    z-index: 1000;
}





/* === ПОРТФОЛИО === */
.portfolio {
    padding: 80px 0;
    width: 100%;
    background: #f8f8f8;
    box-sizing: border-box;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* Ключевое исправление */
    gap: 15px;
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.portfolio-card {
    aspect-ratio: 2/3;
    perspective: 1200px;
    cursor: pointer;
    min-width: 0; /* Важно для предотвращения выхода за пределы */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 1.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    border-radius: 0;
}

.portfolio-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, 
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
    background: transparent;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Адаптивность портфолио */
@media (max-width: 1600px) {
    .portfolio-grid {
        gap: 12px;
    }
}

@media (max-width: 1400px) {
    .portfolio-grid {
        gap: 10px;
    }
}

@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 колонки */
    }
}

@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 колонки */
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 колонки */
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .portfolio-grid {
        grid-template-columns: minmax(0, 1fr); /* 1 колонка */
        gap: 15px;
        max-width: 400px;
    }
}



/* === Презентация картин === */
.presentation {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.presentation-container {
    position: relative;
    width: 100%;
    height: 80vh;
    max-height: 700px;
    min-height: 500px;
    overflow: visible;
}

.art-piece {
    position: absolute;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    transition: 
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.8s ease;
    will-change: transform;
    z-index: 1;
    cursor: pointer;
    overflow: hidden;
    backface-visibility: hidden;
    animation: float 8s ease-in-out infinite;
    /* Фиксированные размеры вместо процентных */
    width: 220px;
    height: 300px;
    aspect-ratio: 2/3; /* Сохраняем соотношение сторон */
}

/* Анимация плавания */
@keyframes float {
    0% { transform: translateY(0) rotate(var(--rotate, 0)); }
    50% { transform: translateY(-20px) rotate(calc(var(--rotate, 0) + 2deg)); }
    100% { transform: translateY(0) rotate(var(--rotate, 0)); }
}

/* Разные скорости анимации */
.art-piece:nth-child(1) { 
    animation-duration: 12s; 
    --rotate: -5deg;
    top: 10%;
    left: 5%;
}

.art-piece:nth-child(2) { 
    animation-duration: 9s; 
    --rotate: 7deg;
    top: 15%;
    left: 25%;
}

.art-piece:nth-child(3) { 
    animation-duration: 14s; 
    --rotate: -8deg;
    top: 5%;
    left: 45%;
}

/* 4-я картина - выше и левее */
.art-piece:nth-child(4) { 
    animation-duration: 11s; 
    --rotate: 4deg;
    top: 12% !important; /* Выше */
    left:65% !important; /* Левее */
}

.art-piece:nth-child(5) { 
    animation-duration: 13s; 
    --rotate: -3deg;
    top: 65%;
    left: 10%;
}

.art-piece:nth-child(6) { 
    animation-duration: 10s; 
    --rotate: 6deg;
    top: 60%;
    left: 35%;
}

/* 7-я картина - выше и левее */
.art-piece:nth-child(7) { 
    animation-duration: 15s; 
    --rotate: -7deg;
    top: 60% !important; /* Выше */
    left: 60% !important; /* Левее */
}

/* 8-я картина - сдвинута левее и адаптирована */
.art-piece:nth-child(8) { 
    top: 40% !important; /* Выше */
    left: 80% !important; /* Левее */
    --rotate: -8deg !important;
    animation-duration: 7s !important;
}

/* Кнопка (без изменений) */
.btn-gallery {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(197, 197, 197, 0.2);    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    color: rgba(255, 255, 255, 0.95);
    padding: 15px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 1px;
    
    box-shadow: 0 8px 25px rgba(104, 104, 104, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(0, 0, 0, 0.5);
}

.btn-gallery:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #000;
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 12px 30px rgba(73, 59, 151, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-gallery:hover path {
    stroke: #000 !important;
}

.btn-gallery svg {
    transition: transform 0.5s ease;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.btn-gallery:hover svg {
    transform: translateX(5px);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

@supports not (backdrop-filter: blur(10px)) {
    .btn-gallery {
        background: rgba(238, 238, 238, 0.85);
    }
    .btn-gallery:hover {
        background: rgba(255, 255, 255, 0.85);
    }
}

/* Адаптивность с улучшенными позициями */
@media (max-width: 1400px) {
    .presentation-container {
        min-height: 450px;
    }
    
    .art-piece {
        width: 200px;
        height: 270px;
    }
    
}

@media (max-width: 1200px) {
    .art-piece {
        width: 180px;
        height: 240px;
    }
    
}

@media (max-width: 992px) {
    .art-piece {
        width: 170px;
        height: 230px;
    }
    
    /* Обновленные позиции для всех картин */
    .art-piece:nth-child(1) { top: 8%; left: 3%; }
    .art-piece:nth-child(2) { top: 12%; left: 23%; }
    .art-piece:nth-child(3) { top: 3%; left: 43%; }
    .art-piece:nth-child(4) { top: 18%; left: 65%; } /* Левее */
    .art-piece:nth-child(5) { top: 62%; left: 8%; }
    .art-piece:nth-child(6) { top: 58%; left: 33%; }
    .art-piece:nth-child(7) { top: 50%; left: 20%; } /* Сохраняем левее */
    .art-piece:nth-child(8) { 
        top: 35% !important; 
        left: 80% !important; /* Левее для адаптации */
    }
}

@media (max-width: 768px) {
    .presentation {
        padding: 60px 0;
    }
    
    .presentation-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .art-piece {
        width: 140px;
        height: 190px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }
    
    .btn-gallery {
        padding: 12px 30px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .presentation-container {
        height: 70vh;
        min-height: 500px;
    }
    
    .art-piece {
        width: 120px;
        height: 160px;
    }
    
    .art-piece:nth-child(1) { top: 5%; left: 2%; }
    .art-piece:nth-child(2) { top: 10%; left: 25%; }
    .art-piece:nth-child(3) { top: 2%; left: 50%; }
    .art-piece:nth-child(4) { top: 15%; left: 75%; }
    .art-piece:nth-child(5) { top: 65%; left: 5%; }
    .art-piece:nth-child(6) { top: 60%; left: 30%; }
    .art-piece:nth-child(7) { top: 50%; left: 50%; } /* Центрируем на малых экранах */
    .art-piece:nth-child(8) { 
        top: 35% !important; 
        left: 75% !important;
    }
}

@media (max-width: 480px) {
    .art-piece {
        width: 100px;
        height: 140px;
    }
    
    .btn-gallery {
        width: 90%;
        text-align: center;
        justify-content: center;
        bottom: 30px;
    }
}



/* === Современный минималистичный дизайн блога === */
.blog-page {
    width: 100%;
    max-width: 1600px;
    margin: 100px auto 0;
    padding: 0 40px;
    box-sizing: border-box;
}

.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 100px;
    width: 100%;
}

.blog-post {
    position: relative;
    opacity: 0;
    transition: all 1.5s cubic-bezier(0.23, 1, 0.32, 1); /* Оптимальная длительность */
    width: 80%;
    max-width: 1000px;
}

.blog-post.animate-left {
    transform: translateX(-180px); /* Умеренное смещение */
    align-self: flex-start;
}

.blog-post.animate-right {
    transform: translateX(180px); /* Умеренное смещение */
    align-self: flex-end;
}

.blog-post.visible {
    opacity: 1;
    transform: translate(0, 0) !important;
}

/* Контейнеры для рамок */
.post-frame-container {
    position: relative;
    padding: 0 0 20px 20px; /* Смещение для рамок */
}

.post-frame-inner {
    position: relative;
    padding: 0 0 15px 15px; /* Смещение для внутренней рамки */
}

/* Основной контент */
.post-content-wrapper {
    background: #fff;
    position: relative;
    padding: 50px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    
    /* Тень для верхней и правой стороны */
    box-shadow: 15px -15px 30px rgba(0, 0, 0, 0.05),
                15px 15px 30px rgba(0, 0, 0, 0.05);
}

/* Рамки (поменяли цвета местами) */
.post-frame-container:before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: calc(66.66% - 30px); /* 2/3 ширины */
    height: calc(66.66% - 30px); /* 2/3 высоты */
    border-left: 15px solid #ccc; /* Серая рамка короче */
    border-bottom: 15px solid #ccc; /* Серая рамка короче */
    z-index: -1;
}

.post-frame-container:after {
    content: '';
    position: absolute;
    left: 15px;
    bottom: 15px;
    width: calc(98.66% - 80px); /* 2/3 ширины */
    height: calc(98.66% - 80px); /* 2/3 высоты */
    border-left: 10px solid #000; /* Черная рамка на всю длину */
    border-bottom: 10px solid #000; /* Черная рамка на всю длину */    
    z-index: -1;
}

/* Новые шрифты для заголовка и описания */
.post-title {
    font-family: 'Montserrat', sans-serif; /* Новый шрифт */
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0 auto 50px;
    text-align: center;
    max-width: 70%;
    position: relative;
    padding-bottom: 25px;
    letter-spacing: -0.5px;
}

.post-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: #000;
}

.post-title a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #555;
}

.post-content {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.post-thumbnail {
    flex: 0 0 45%;
}

.post-thumbnail img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1); 
}

.post-thumbnail a:hover img {
    transform: scale(1.03); 
}

.post-excerpt {
    flex: 1;
    font-family: 'Lora', serif; /* Новый шрифт для описания */
    font-size: 1.2rem;
    line-height: 1.9;
    padding-top: 15px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.read-more {
    display: inline-block;
    margin-top: 40px;
    padding: 15px 40px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.7s ease;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 1rem;
    float: right;
    border: 2px solid #000;
    font-family: 'Montserrat', sans-serif; /* Единый шрифт для кнопки */
}

.read-more:hover {
    background: #fff !important;
    color: #000 !important;
    transform: translateY(-5px);
}

.blog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 100px;
    width: 100%;
}

.blog-pagination .page-numbers {
    display: inline-block;
    padding: 15px 30px;
    margin: 0 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.7s ease;
    font-weight: 500;
    color: #000;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif; /* Единый шрифт */
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Стили для отдельного поста (single.php) */
.single-post-container {
    max-width: 900px;
    margin: 100px auto;
    padding: 0 20px;
}

.single-post-content {
    background: #fff;
    padding: 60px;
    position: relative;
    /* Увеличенная объемная тень */
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18),
                0 15px 40px rgba(0, 0, 0, 0.12);
    border-radius: 4px; /* Легкое скругление для мягкости */
}

.single-post-header {
    text-align: center;
    margin-bottom: 50px;
}

.single-post-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.single-post-meta {
    font-family: 'Montserrat', sans-serif;
    color: #777;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.single-post-thumbnail {
    margin-bottom: 50px;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.single-post-text {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    line-height: 1.9;
    color: #333;
}

.single-post-text p {
    margin-bottom: 30px;
}

/* Адаптивность */
@media (max-width: 1400px) {
    .blog-post {
        width: 85%;
    }
}

@media (max-width: 1200px) {
    .blog-page {
        padding: 0 30px;
    }
    
    .blog-post {
        width: 90%;
    }
    
    .post-content-wrapper {
        padding: 40px;
    }
    
    .post-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .blog-posts {
        gap: 80px;
    }
    
    .blog-post {
        width: 95%;
    }
    
    .post-content {
        gap: 40px;
    }
    
    .post-title {
        font-size: 2rem;
        max-width: 80%;
    }
    
    .single-post-container {
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .blog-page {
        margin: 80px auto 0;
        padding: 0 20px;
    }
    
    .blog-posts {
        gap: 70px;
    }
    
    .blog-post {
        width: 100%;
    }
    
    .post-content-wrapper {
        padding: 30px;
    }
    
    .post-content {
        flex-direction: column;
    }
    
    .post-thumbnail {
        width: 100%;
    }
    
    .post-title {
        font-size: 1.8rem;
        max-width: 100%;
    }
    
    .single-post-container {
        margin: 80px auto;
    }
    
    .single-post-content {
        padding: 40px;
    }
    
    .single-post-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 576px) {
    .blog-page {
        padding: 0 15px;
    }
    
    .post-content-wrapper {
        padding: 25px;
    }
    
    .post-title {
        font-size: 1.6rem;
        padding-bottom: 20px;
    }
    
    .post-title:after {
        width: 100px;
    }
    
    .read-more {
        width: 100%;
        text-align: center;
        float: none;
        margin-top: 30px;
    }
    
    .blog-pagination .page-numbers {
        padding: 12px 20px;
        margin: 0 5px;
        font-size: 0.9rem;
    }
    
    .post-frame-container:before,
    .post-frame-container:after {
        display: none;
    }
    
    .single-post-content {
        padding: 30px;
    }
    
    .single-post-title {
        font-size: 1.8rem;
    }
    
    .single-post-text {
        font-size: 1.1rem;
    }
}

/* Обновленные стили для кнопки "Назад в блог" */
.back-to-blog-container {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 100;
}

.back-to-blog-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    text-decoration: none;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    border: 1px solid #eee;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    animation: fadeIn 0.5s forwards 0.3s;
    padding: 10px 16px;
    overflow: hidden;
}

.back-to-blog-btn:hover {
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.back-to-blog-btn:hover svg path {
    fill: #fff;
}

.back-to-blog-btn svg {
    min-width: 18px;
    transition: transform 0.3s ease;
    margin-right: 8px;
}

.back-to-blog-btn:hover svg {
    transform: translateX(-3px);
}

.back-to-blog-btn svg path {
    fill: #000;
    transition: fill 0.3s ease;
}

.btn-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    color: #000;
    transition: color 0.3s ease;
}

.back-to-blog-btn:hover .btn-text {
    color: #fff;
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .back-to-blog-container {
        right: 20px;
        bottom: 20px;
    }
    
    .back-to-blog-btn {
        padding: 8px 14px;
    }
    
    .btn-text {
        font-size: 13px;
    }
    
    .back-to-blog-btn svg {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
}

@media (max-width: 480px) {
    .back-to-blog-container {
        right: 15px;
        bottom: 15px;
    }
    
    .back-to-blog-btn {
        padding: 7px 12px;
    }
    
    .btn-text {
        font-size: 12px;
    }
    
    .back-to-blog-btn svg {
        width: 15px;
        height: 15px;
        margin-right: 5px;
    }
}





/* ====================== */
/* Front Page Latest Posts */
/* ====================== */
.front-latest-posts {
    background: #000;
    padding: 80px 0;
}

.front-posts-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.front-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.front-post-card {
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    padding-bottom: 40px; /* Пространство для кнопки */
}

.front-post-thumbnail {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.front-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.front-post-content {
    padding: 25px 25px 40px; /* Увеличиваем нижний отступ */
    display: flex;
    flex-direction: column;
}

.front-post-title {
    font-size: 1.4rem;
    margin: 0 0 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.front-post-title a {
    color: #000;
    text-decoration: none;
}

.title-line {
    width: 60px;
    height: 1px;
    background: #000;
    margin: 0 auto 20px;
}

.front-post-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0;
    font-family: 'Lora', serif;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Ограничиваем до 4 строк */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 6.4em; /* 4 строки * 1.6 line-height */
}

.front-read-more {
    display: inline-block;
    padding: 12px 30px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.4s ease;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    border: 2px solid #fff; /* Белый контур */
    font-family: 'Montserrat', sans-serif;
    position: absolute;
    bottom: -20px; /* Выносим наполовину за пределы карточки */
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.front-read-more:hover {
    background: #fff;
    color: #000;
    border-color: #000; /* Черный контур при наведении */
    transform: translateX(-50%) translateY(-5px);
}


/* Адаптивность */
@media (max-width: 1200px) {
    .front-posts-grid {
        gap: 20px;
    }
    
    .front-post-thumbnail {
        height: 200px;
    }
    
    .front-post-excerpt {
        -webkit-line-clamp: 3; /* 3 строки на планшетах */
        min-height: 4.8em; /* 3 строки * 1.6 line-height */
    }
}

@media (max-width: 992px) {
    .front-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .front-post-card {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .front-read-more {
        padding: 10px 25px;
        font-size: 0.8rem;
        bottom: -15px;
    }
}

@media (max-width: 768px) {
    .front-latest-posts {
        padding: 60px 0;
    }
    
    .front-posts-grid {
        grid-template-columns: 1fr;
        gap: 50px; /* Увеличиваем расстояние между карточками */
    }
    
    .front-post-thumbnail {
        height: 250px;
    }
    
    .front-post-excerpt {
        -webkit-line-clamp: 4;
        min-height: 6.4em;
    }
}

@media (max-width: 576px) {
    .front-posts-container {
        padding: 0 15px;
    }
    
    .front-post-thumbnail {
        height: 220px;
    }
    
    .front-post-title {
        font-size: 1.3rem;
    }
    
    .front-post-content {
        padding: 20px 20px 40px;
    }
    
    .front-read-more {
        padding: 10px 20px;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
}





/* === Сетка галереи - исправленная версия с пропорциями === */
.gallery-grid-page {
    padding: 50px 0;
    background: #0e263d;
    min-height: calc(100vh - 80px); /* Учитываем высоту шапки */
}

.gallery-grid-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

.gallery-grid {
    margin: 0 auto;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(9, 20, 49, 0.8) 0%, rgb(6, 25, 49) 70%);
    padding: 3.5px;
    border-radius: 8px;
    box-shadow: 
        inset 0 0 30px rgba(255, 255, 255, 0.1),
        inset 0 0 60px rgba(255, 255, 255, 0.05);
}

.grid-sizer, .grid-item {
    width: calc(20% - 7px);
}

.grid-item {
    margin-bottom: 7px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 
        0 0 5px rgba(255, 255, 255, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Ключевое изменение: контейнер для сохранения пропорций */
    aspect-ratio: var(--aspect-ratio, 1/1);
}

/* Установка пропорций через CSS переменные */
.grid-item[data-orientation="horizontal"] { --aspect-ratio: 4/3; }
.grid-item[data-orientation="vertical"]   { --aspect-ratio: 3/4; }
.grid-item[data-orientation="square"]     { --aspect-ratio: 1/1; }

.grid-item:hover {
    transform: scale(1.03);
    z-index: 10;
    box-shadow: 
        0 0 15px rgba(9, 147, 240, 0.6),
        inset 0 0 20px rgba(77, 187, 250, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.grid-item-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.9);
}

.grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0.9;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    padding: 20px;
    text-align: center;
}

.grid-title {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    font-weight: 600;
}

.grid-dimensions {
    color: #ccc;
    font-size: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.grid-item:hover img {
    transform: scale(1.1);
    opacity: 1;
}

.grid-item:hover .grid-overlay {
    opacity: 1;
}

.grid-item:hover .grid-title,
.grid-item:hover .grid-dimensions {
    transform: translateY(0);
    opacity: 1;
}

/* Кнопка просмотра всех картин */
.view-all-container {
    text-align: center;
    padding: 40px 0;
}

.view-all-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: #002f44;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
}

.view-all-button:hover {
    background: #004869;
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(79, 195, 247, 0.8);
}

/* Адаптивность сетки */
@media (max-width: 1600px) {
    .grid-sizer, .grid-item {
        width: calc(25% - 7px);
    }
}

@media (max-width: 1200px) {
    .grid-sizer, .grid-item {
        width: calc(33.333% - 7px);
    }
}

@media (max-width: 992px) {
    .grid-sizer, .grid-item {
        width: calc(50% - 7px);
    }
    
    .gallery-grid {
        padding: 3px;
    }
}

@media (max-width: 768px) {
    .gallery-grid-page {
        padding: 20px 0;
    }
    
    .grid-sizer, .grid-item {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .grid-title {
        font-size: 1.2rem;
    }
    
    .grid-dimensions {
        font-size: 0.9rem;
    }
    
    .view-all-button {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
}

/* Исправленные стили для лайтбоксов */
/* Общий фикс для body при открытых лайтбоксах */
body.lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.lightbox-modal, .all-paintings-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow: auto;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 30, 0.95);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Кнопки навигации - перемещены вниз */
.lightbox-prev, .lightbox-next, 
.all-viewer-prev, .all-viewer-next {
    position: absolute;
    bottom: 20px; /* Перемещены вниз */
    transform: translateY(0); /* Убрано вертикальное центрирование */
    background: rgba(0, 0, 0, 0.6);
    color: #4fc3f7;
    border: none;
    width: 50px; /* Уменьшен размер */
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.lightbox-prev, .all-viewer-prev {
    left: 20px; /* Остается слева */
}

.lightbox-next, .all-viewer-next {
    right: 20px; /* Остается справа */
}

.lightbox-prev:hover, .lightbox-next:hover,
.all-viewer-prev:hover, .all-viewer-next:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #29b6f6;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.8);
}

/* Кнопка закрытия - перемещена в верхний правый угол */
.lightbox-close, .all-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ff0000;
    font-size: 32px; /* Уменьшен размер */
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    width: 40px; /* Уменьшен размер */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.lightbox-close:hover, .all-viewer-close:hover {
    background: rgba(0, 0, 0, 0.9);
    color: #ff3333;
    transform: scale(1.1);
    border-color: rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

/* Основное изображение */
.lightbox-main-image {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 60vh;
}

.lightbox-main-image img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Информационная панель */
.lightbox-info {
    padding: 20px;
    background: rgba(10, 10, 20, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative; /* Для позиционирования названия */
}

.lightbox-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    width: 100%;
}

.lightbox-title-wrapper,
.lightbox-dimensions-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-size: 1rem;
    color: #aaa;
    font-weight: 500;
}

.lightbox-title {
    font-size: 1.8rem;
    margin: 0;
    color: #fff;
    font-weight: 600;
    text-align: center; /* Центрирование текста */
}

.lightbox-dimensions {
    font-size: 1.4rem;
    color: #e0e0ff;
    text-align: center; /* Центрирование текста */
}

.lightbox-link {
    display: inline-block;
    padding: 12px 25px;
    background: transparent;
    color: #4fc3f7;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid #003c58;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.lightbox-link:hover {
    color: #fff;
    background: rgba(79, 195, 247, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(79, 195, 247, 0.8);
}

/* Миниатюры */
.lightbox-thumbnails {
    display: flex;
    justify-content: center;
    padding: 15px 0;
    gap: 10px;
    overflow-x: auto;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    width: 100%;
}

.lightbox-thumb {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    position: relative;
}

.lightbox-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.lightbox-thumb.active {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Стили для просмотра всех картин */
.all-paintings-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow: auto;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.all-viewer-main {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1400px;
    max-height: 90vh;
}

.all-viewer-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Название картины - перемещено в центр */
.all-viewer-caption {
    position: absolute;
    left: 50%; /* Центрирование по горизонтали */
    bottom: 20px; /* Остается внизу */
    transform: translateX(-50%); /* Центрирование */
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    font-size: 1.2rem;
    max-width: 90%; /* Ограничение ширины */
    text-align: center; /* Центрирование текста */
    z-index: 5; /* Убедимся, что поверх изображения */
}

/* Адаптивность лайтбоксов */
@media (max-width: 1200px) {
    .lightbox-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .lightbox-title-wrapper,
    .lightbox-dimensions-wrapper {
        flex-basis: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 992px) {
    .lightbox-main-image {
        padding: 20px;
    }
    
    .lightbox-prev, .lightbox-next,
    .all-viewer-prev, .all-viewer-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 15px;
    }
    
    .lightbox-title {
        font-size: 1.6rem;
    }
    
    .lightbox-dimensions {
        font-size: 1.2rem;
    }
    
    .lightbox-header {
        gap: 10px;
    }
    
    .lightbox-close, .all-viewer-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 768px) {
    .lightbox-main-image {
        min-height: 50vh;
        padding: 10px;
    }
    
    .lightbox-main-image img {
        max-height: 50vh;
    }
    
    .lightbox-title {
        font-size: 1.4rem;
    }
    
    .lightbox-dimensions {
        font-size: 1.1rem;
    }
    
    .lightbox-thumb {
        width: 60px;
        height: 60px;
    }
    
    .lightbox-link {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .all-viewer-caption {
        font-size: 1rem;
        bottom: 15px;
        padding: 8px 15px;
    }
    
    .all-viewer-prev, .all-viewer-next {
        bottom: 10px;
    }
}

@media (max-width: 576px) {
    .lightbox-header {
        flex-direction: column;
        align-items: center;
    }
    
    .lightbox-title-wrapper,
    .lightbox-dimensions-wrapper {
        flex-basis: auto;
    }
    
    .lightbox-prev, .lightbox-next,
    .all-viewer-prev, .all-viewer-next {
        width: 36px;
        height: 36px;
        font-size: 16px;
        bottom: 10px;
    }
    
    .lightbox-close, .all-viewer-close {
        top: 10px;
        right: 10px;
        font-size: 24px;
        width: 32px;
        height: 32px;
    }
    
    .all-viewer-caption {
        font-size: 0.9rem;
        bottom: 10px;
        padding: 6px 12px;
    }
}




/* ====================== */
/* Contacts Page */
/* ====================== */
.contacts-page {
    padding: 80px 0 10px; /* Уменьшен нижний отступ */
    background: #f9f9f9;
    min-height: 100vh;
}

.contacts-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 50px;
}

.contact-info, .contact-form {
    flex: 1;
    background: #fff;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.05);
    border-radius: 8px;
}

.contact-info h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
    color: #000;
    font-family: 'Playfair Display', serif;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.contact-item svg {
    width: 24px;
    height: 24px;
    fill: #000;
    margin-right: 15px;
    flex-shrink: 0;
}

.contact-item h2 {
    font-size: 1.1rem;
    margin: 0 0 5px;
    font-weight: 600;
    color: #222;
}

.contact-item p {
    margin: 0;
    color: #555;
    font-size: 1rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    margin: 0;
}

.social-icon:hover {
    transform: translateY(-5px);
}

/* Цвета иконок */
.telegram { background: #2AABEE; }
.whatsapp { background: #25D366; }
.vk { background: #4C75A3; }
.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.contact-form h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 600;
    color: #000;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    border-radius: 4px;
    transition: border 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #000;
    outline: none;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
}

.submit-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

.form-response {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.form-response.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.form-response.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* Адаптивность */
@media (max-width: 992px) {
    .contacts-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .contact-info, .contact-form {
        padding: 30px;
    }
}

@media (max-width: 576px) {
    .contacts-page {
        padding: 50px 0;
    }
    
    .contact-info, .contact-form {
        padding: 25px;
    }
    
    .contact-info h1 {
        font-size: 2rem;
    }
    
    .contact-form h2 {
        font-size: 1.5rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Стили для ошибок валидации */
.input-error {
    border-color: #ff3860 !important;
    box-shadow: 0 0 0 0.125em rgba(255, 56, 96, 0.25);
}

/* Анимации для ответа формы */
.form-response {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}








/* ========== ОБЩИЕ СТИЛИ ========== */
.gallery-page {
    padding: 60px 0;
    background: transparent !important;
}

.gallery-container {
    max-width: 100%;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box; /* Добавлено */
}

.painting-section {
    max-width: 1600px;
    margin: 0 auto 100px;
    opacity: 0;
    transition: opacity 0.8s ease;
    padding: 0 15px; /* Добавлено */
    box-sizing: border-box; /* Добавлено */
}

.painting-section.active {
    opacity: 1;
}

.painting-container {
    display: flex;
    gap: 70px;
    align-items: center;
    width: 100%;
    box-sizing: border-box; /* Добавлено */
}

/* ========== СТИЛИ ДЛЯ КАРТИНЫ ========== */
.painting-image {
    flex: 1;
    position: relative;
    z-index: 1;
    transform: translateX(-100px);
    opacity: 0;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 1.5s ease;
    max-width: 100%; /* Добавлено */
}

.painting-section.active .painting-image {
    transform: translateX(0);
    opacity: 1;
}

.image-frame {
    position: relative;
    background: transparent !important;
    border-radius: 4px;
    box-shadow: -8px 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.5s ease;
    padding: 0 !important;
    max-width: 100%; /* Добавлено */
}

/* Тонкая темно-серая рамка вокруг изображения */
.image-frame img {
    border: 3px solid #333;
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-wrapper {
    position: relative;
    overflow: hidden;
    max-width: 100%; /* Добавлено */
}

/* Ориентации изображений */
.painting-portrait .image-wrapper {
    max-height: 50vh;
    aspect-ratio: 2/3;
}

.painting-landscape .image-wrapper {
    max-height: 60vh;
    aspect-ratio: 4/3;
}

.painting-square .image-wrapper {
    max-height: 70vh;
    aspect-ratio: 1/1;
}

.expand-trigger {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: all 0.3s ease;
    animation: pulse 3s infinite;
    border: 1px solid rgba(0,0,0,0.05);
}

.expand-trigger:hover {
    transform: scale(1.1);
    background: #fff;
    animation: none;
}

.cross-icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.cross-icon::before,
.cross-icon::after {
    content: '';
    position: absolute;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.cross-icon::before {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.cross-icon::after {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.expand-trigger:hover .cross-icon::before,
.expand-trigger:hover .cross-icon::after {
    background: #000;
    transform: rotate(135deg);
}

@keyframes pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); 
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); 
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); 
    }
}

/* ========== СТИЛИ ДЛЯ ОПИСАНИЯ ========== */
.painting-details {
    flex: 1;
    position: relative;
    transform: translateY(-80px);
    opacity: 0;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s, 
                opacity 1.5s ease 0.3s;
}

.painting-section.active .painting-details {
    transform: translateY(0);
    opacity: 1;
}

.details-container {
    position: relative;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 15px 15px 30px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.painting-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    color: #2c3e50;
    position: relative;
    padding-bottom: 15px;
}

.title-divider {
    width: 60px;
    height: 2px;
    background: #222;
    margin: 0 auto 20px;
}

.painting-description {
    line-height: 1.7;
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 25px;
    text-align: center;
    font-style: italic;
}

.painting-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.meta-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.meta-item i {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 50%;
    font-size: 0.9rem;
}

/* Обновленные стили статусов */
.status-sold {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.status-sold i {
    background: rgba(220, 53, 69, 0.2) !important;
    color: #dc3545 !important;
}

.status-for_sale {
    background: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
}

.status-for_sale i {
    background: rgba(40, 167, 69, 0.2) !important;
    color: #28a745 !important;
}

.status-not_for_sale {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #000 !important;
}

.status-not_for_sale i {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #000 !important;
}

.actions-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
    color: #495057;
    position: relative;
    padding-bottom: 10px;
}

.actions-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: #dee2e6;
}

.painting-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.order-custom, .blog-link, .buy-painting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
}

.order-custom {
    background: #343a40;
    color: #fff;
    cursor: pointer;
}

.order-custom:hover {
    background: #212529;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.buy-painting {
    background: #28a745;
    color: #fff;
    cursor: pointer;
}

.buy-painting:hover {
    background: #218838;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.blog-link {
    background: transparent;
    color: #495057;
    border: 1px solid #dee2e6;
    text-decoration: none;
    margin-top: 15px;
}

.blog-link:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.no-paintings {
    text-align: center;
    padding: 100px 20px;
    font-size: 1.5rem;
    color: #6c757d;
}

.price-item {
    background: rgba(255, 140, 0, 0.1) !important;
    color: #ff9100 !important;
    font-weight: bold;
}

.price-item i {
    background: rgba(255, 140, 0, 0.2) !important;
    color: #ff9900 !important;
}

/* Lightbox fixes */
.lightbox {
    transition: opacity 0.3s ease-in-out !important;
}
.lb-image {
    transition: transform 0.3s ease-in-out !important;
}

/* Обновленные стили для поиска */
.sticky-search-container {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px; /* Уменьшены отступы */
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    margin: 0 auto 30px; /* Центрирование */
    max-width: min(95%, 800px); /* Адаптивная ширина */
    width: auto;
    backdrop-filter: blur(10px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.search-box {
    position: relative;
    max-width: 100%; /* Гарантирует, что не выйдет за пределы */
    width: 100%;
    margin: 0 auto;
}

#painting-search {
    width: 100%;
    padding: 10px 15px 10px 40px; /* Уменьшены отступы */
    font-size: 15px; /* Уменьшен размер шрифта */
    border: 1px solid #e0e0e0; /* Тонкая граница */
    border-radius: 50px;
    outline: none;
    transition: all 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box; /* Важно! */
}

.search-box i {
    position: absolute;
    left: 15px; /* Смещена иконка */
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 16px; /* Уменьшен размер иконки */
}

/* Контейнер меток */
.paintings-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
    justify-content: center;
}

/* Сами метки */
.painting-tag {
    background: #f0f2f5;
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.painting-tag:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    transform: translateY(-2px);
}

/* Кнопка "Наверх" */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0.7;
    border: none;
    transition: opacity 0.3s, transform 0.3s;
    display: none;
}

.scroll-to-top.visible {
    display: flex;
}

.scroll-to-top:hover {
    opacity: 1;
    transform: translateY(-5px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1400px) {
    .painting-container {
        gap: 50px;
    }
}

@media (max-width: 1200px) {
    .painting-container {
        gap: 30px;
    }
    
    .painting-title {
        font-size: 1.7rem;
    }
    
    .details-container {
        padding: 30px;
    }
}

@media (max-width: 992px) {
    .painting-container {
        flex-direction: column;
        gap: 40px;
        padding: 0 15px; /* Добавлено */
    }
    
    .painting-image {
        width: 100%;
        max-width: 100%; /* Изменено */
        margin: 0 auto;
    }
    
    .painting-portrait .image-wrapper,
    .painting-landscape .image-wrapper,
    .painting-square .image-wrapper {
        max-height: 70vh;
    }
    
    .painting-details {
        width: 100%;
        max-width: 100%; /* Изменено */
        margin: 0 auto;
        padding: 0 10px; /* Добавлено */
    }
}

@media (max-width: 768px) {
    .gallery-page {
        padding: 40px 0;
    }
    
    .painting-section {
        margin-bottom: 70px;
        padding: 0 10px; /* Добавлено */
    }
    
    .painting-title {
        font-size: 1.6rem;
    }
    
    .painting-meta {
        grid-template-columns: 1fr;
    }
    
    .details-container {
        padding: 25px 15px; /* Изменено */
    }
}

@media (max-width: 576px) {
    .gallery-container {
        padding: 0 10px; /* Добавлено */
    }
    
    .painting-title {
        font-size: 1.5rem;
    }
    
    .painting-description {
        font-size: 1rem;
    }
    
    .meta-item {
        font-size: 1rem;
    }
    
    .order-custom, .blog-link, .buy-painting {
        font-size: 1rem;
        padding: 12px 20px;
    }
    
    .expand-trigger {
        width: 40px;
        height: 40px;
    }
    
    .cross-icon {
        width: 16px;
        height: 16px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    /* Исправление выхода за границы экрана */
    .painting-container {
        padding: 0 5px; /* Добавлено */
    }
    
    .details-container {
        padding: 20px 10px; /* Изменено */
    }
    
    .image-frame img {
        max-width: 100%;
    }
    
    .painting-meta {
        padding: 0 5px; /* Добавлено */
    }
    
    .painting-actions {
        padding: 0 5px; /* Добавлено */
    }
}

/* Дополнительные исправления для маленьких экранов */
@media (max-width: 480px) {
    .gallery-container {
        padding: 0 5px; /* Добавлено */
    }
    
    .painting-section {
        padding: 0; /* Добавлено */
    }
    
    .painting-title {
        font-size: 1.4rem;
        padding: 0 10px; /* Добавлено */
    }
    
    .painting-description {
        font-size: 0.95rem;
        padding: 0 10px; /* Добавлено */
    }
    
    .meta-item {
        font-size: 0.9rem;
    }
    
    .details-container {
        padding: 15px 8px; /* Изменено */
    }
    
    .image-frame img {
        border-width: 2px; /* Уменьшено */
    }
    
    .painting-meta {
        gap: 8px; /* Уменьшено */
    }
    
    .title-divider {
        width: 40px; /* Уменьшено */
    }
    
    .actions-title {
        font-size: 1.1rem; /* Уменьшено */
    }
    
    .painting-actions {
        gap: 10px; /* Уменьшено */
    }
    
    .painting-container {
        gap: 20px; /* Уменьшено */
    }
}

/* Исправление для очень маленьких экранов */
@media (max-width: 360px) {
    .painting-title {
        font-size: 1.3rem;
    }
    
    .painting-description {
        font-size: 0.9rem;
    }
    
    .details-container {
        padding: 12px 5px; /* Уменьшено */
    }
    
    .meta-item {
        padding: 8px; /* Уменьшено */
    }
    
    .order-custom, .blog-link, .buy-painting {
        padding: 10px 15px; /* Уменьшено */
        font-size: 0.95rem;
    }
}





/* ====================== */
/* Модальное окно - адаптивная версия */
/* ====================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto; /* Прокрутка при необходимости */
}

.modal-open {
    overflow: hidden; /* Запрет прокрутки основного контента */
}

.modal-content {
    position: relative;
    background: #fff;
    margin: 5vh auto; /* Отступ сверху в vh для адаптивности */
    padding: 25px;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    box-sizing: border-box; /* Учитываем padding в ширине */
    animation: modalAppear 0.4s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    text-align: center;
    margin: 0 0 20px;
    color: #333;
    font-weight: 600;
    font-size: 1.8rem;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #777;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: #000;
    background: #f5f5f5;
    transform: rotate(90deg);
}

/* Форма */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 15px;
}

.form-group label[required]::after {
    content: " *";
    color: #c62828;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.2);
    outline: none;
}

.form-group input.error-field,
.form-group textarea.error-field {
    border-color: #c62828 !important;
}

/* Кнопка */
.submit-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(76,175,80,0.3);
    font-family: inherit;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #43A047, #1B5E20);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(76,175,80,0.4);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76,175,80,0.3);
}

/* Сообщения формы */
.form-message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-message.success {
    background: #e8f5e9;
    color: #2E7D32;
    border: 1px solid #c8e6c9;
}

.form-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.form-note {
    background: #fff8e6;
    border-left: 3px solid #ffa000;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    border-radius: 4px;
}

.form-note i {
    color: #ffa000;
    margin-right: 10px;
    font-size: 18px;
    flex-shrink: 0;
}

/* ====================== */
/* Адаптация для мобильных устройств */
/* ====================== */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px auto;
        padding: 20px;
        width: 90%;
        max-width: 90%;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 15px;
    }
    
    .submit-btn {
        padding: 12px;
        font-size: 15px;
    }
    
    .form-message {
        padding: 10px;
        font-size: 14px;
    }
    
    .form-note {
        padding: 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10px auto;
        padding: 18px;
        width: 95%;
        max-width: 95%;
        border-radius: 10px;
    }
    
    .modal-title {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .close {
        top: 8px;
        right: 12px;
        font-size: 22px;
        width: 36px;
        height: 36px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 11px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 11px;
        font-size: 14px;
    }
    
    .form-message {
        padding: 8px;
        font-size: 13px;
    }
    
    .form-note {
        padding: 8px;
        font-size: 12px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .modal-content {
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 13px;
    }
    
    .submit-btn {
        padding: 10px;
        font-size: 13px;
    }
}
