/* -----------------------------
   ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
   ----------------------------- */
:root {
    --bg-main: #FBE8FF;
    --bg-secondary: #F2B8F0;
    --color-primary: #b385c2;
    --color-primary-hover: #c395d2;
    --color-accent: #774694;
    --color-text-main: #5C4B5E;
    --header-bg: rgba(251, 232, 255, 0.95);
}

[data-theme="dark"] {
    --bg-main: #161117;
    --bg-secondary: #271d29;
    --color-primary: #a170b0;
    --color-primary-hover: #b385c2;
    --color-accent: #d2a9e6;
    --color-text-main: #f0e6f2;
    --header-bg: rgba(22, 17, 23, 0.95);
}

body {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-main);
    background-color: var(--bg-main);
    overflow-x: hidden;
}

/* Запрет скролла при открытых модалках / меню */
.no-scroll {
    overflow: hidden;
}

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

/* -----------------------------
   ТИПОГРАФИКА
   ----------------------------- */
h1,
h2,
h3 {
    font-family: 'Caveat', cursive;
    color: var(--color-accent);
    font-weight: 700;
}

h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

h2 {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

a {
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

/* -----------------------------
   КНОПКИ И UI ЭЛЕМЕНТЫ
   ----------------------------- */
.btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    padding: 15px 35px;
    font-size: 1.3rem;
    border-radius: 30px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(176, 145, 186, 0.4);
}

.btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(176, 145, 186, 0.6);
}

/* -----------------------------
   HEADER И НАВИГАЦИЯ (FLEXBOX)
   ----------------------------- */
.header {
    background-color: var(--header-bg);
    backdrop-filter: blur(5px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(92, 75, 94, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    color: var(--color-accent);
    margin-left: -10px;
    /* Сдвиг немного левее, как просил пользователь */
    white-space: nowrap;
    padding-right: 30px;
    /* Добавляем отступ справа, чтобы текст не наезжал на меню */
}

.nav-list {
    display: flex;
    gap: 1.2rem;
    /* Ещё немного уменьшаем отступ между ссылками */
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 1.2rem;
    position: relative;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-accent);
    padding: 5px;
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.1);
}

/* Кнопка "Записаться" в шапке */
.nav-btn {
    padding: 10px 25px;
    font-size: 1.1rem;
    box-shadow: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* -----------------------------
   БУРГЕР-МЕНЮ (MOBILE)
   ----------------------------- */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    z-index: 101;
}

.burger span {
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Анимация крестика */
.burger.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

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

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

/* -----------------------------
   СЕКЦИЯ HERO
   ----------------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 80px;
    /* Отступ на высоту шапки */
    background-color: var(--bg-secondary);
    /* Установлен сплошной цвет --bg-secondary */
    position: relative;
    overflow: hidden;
    /* Чтобы бабочки не вылетали за пределы */
}

/* Анимация бабочек */
.butterfly {
    position: absolute;
    width: 120px;
    height: 120px;
    background: url('../assets/images/butterfly.jpg') no-repeat center/contain;
    /* Убираем черный фон у картинки, оставляя только светлую бабочку */
    mix-blend-mode: screen;
    opacity: 0.8;
    animation: float 8s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.b-1 {
    top: 15%;
    left: 5%;
    width: 100px;
    height: 100px;
    animation-duration: 9s;
}

.b-2 {
    top: 65%;
    right: 10%;
    width: 150px;
    height: 150px;
    animation-duration: 11s;
    animation-delay: 2s;
}

.b-3 {
    top: 75%;
    left: 15%;
    width: 80px;
    height: 80px;
    animation-duration: 7s;
    animation-delay: 1s;
}

.b-4 {
    top: 20%;
    right: 20%;
    width: 120px;
    height: 120px;
    animation-duration: 10s;
    animation-delay: 3s;
}

.b-5 {
    top: 45%;
    left: 25%;
    width: 90px;
    height: 90px;
    animation-duration: 12s;
    animation-delay: 5s;
}

.b-6 {
    top: 55%;
    right: 30%;
    width: 110px;
    height: 110px;
    animation-duration: 8s;
    animation-delay: 4s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(25px, -35px) rotate(15deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    /* Чтобы контент был поверх бабочек */
    width: 100%;
}

.hero p {
    font-size: 1.5rem;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    color: var(--color-text-main);
}

.hero-grid {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.hero-text p {
    margin: 0 0 1.5rem 0;
}

.hero-img {
    width: 40%;
    height: 40%;
    object-fit: cover;
    aspect-ratio: 4/5;
    transition: transform 0.6s ease;
}

/* -----------------------------
   СЕКЦИЯ ПОРТФОЛИО (CSS GRID)
   ----------------------------- */
.portfolio {
    padding: 100px 0;
}

.portfolio-grid {
    display: grid;
    /* Автоматически умещаем колонки от 280px до 1fr */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.portfolio-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(92, 75, 94, 0.08);
    cursor: pointer;
    position: relative;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/5;
    transition: transform 0.6s ease;
}

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

.portfolio-item::after {
    content: '🔍 Увеличить';
    position: absolute;
    inset: 0;
    background: rgba(176, 145, 186, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-family: 'Caveat', cursive;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.portfolio-item:hover::after {
    opacity: 1;
}

/* -----------------------------
   СЕКЦИЯ ПРАЙС-ЛИСТ (FLEXBOX)
   ----------------------------- */
.pricing {
    padding: 100px 0;
    background-color: var(--bg-secondary);
}

.pricing-cards {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    /* Позволяет карточкам переноситься на новую строку */
}

.pricing-card {
    flex: 1;
    min-width: 300px;
    background-color: var(--bg-main);
    padding: 50px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(92, 75, 94, 0.05);
    border: 2px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.pricing-card h3:last-child {
    margin-top: 1.5rem;
    margin-bottom: 0;
    color: var(--color-primary);
}

.pricing-card .desc {
    text-align: center;
    font-size: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pricing-card .desc p {
    margin-bottom: 1rem;
}

.pricing-card .desc p:last-child {
    margin-bottom: 0;
}

/* -----------------------------
   ФУТЕР
   ----------------------------- */
.footer {
    padding: 70px 0 50px;
    background-color: #935ca9;
    /* Обновленный цвет футера */
    color: var(--bg-main);
}

.footer h3 {
    color: var(--bg-main);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer a {
    color: var(--bg-main);
}

.footer a:hover {
    color: var(--bg-secondary);
    text-decoration: underline;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

/* -----------------------------
   ВСПЛЫВАЮЩИЙ ВИДЖЕТ ЗАПИСИ (DIKIDI)
   ----------------------------- */
.booking-modal-content {
    position: relative;
    width: 95%;
    max-width: 600px;
    height: 80vh;
    background-color: var(--bg-main);
    border-radius: 12px;
    /* Убрано overflow: hidden, чтобы крестик не обрезался */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.booking-modal-content iframe {
    border-radius: 12px;
}

.booking-close {
    position: absolute;
    top: -15px;
    right: -15px;
    color: var(--color-text-main);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    z-index: 10;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.booking-close:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* -----------------------------
   ЛАЙТБОКС (ГАЛЕРЕЯ ПОРТФОЛИО)
   ----------------------------- */
.lightbox {
    display: none;
    /* Скрыто по умолчанию */
    position: fixed;
    z-index: 1000;
    inset: 0;
    /* Сокращение для top:0, left:0, right:0, bottom:0 */
    background-color: rgba(92, 75, 94, 0.95);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--bg-main);
    font-size: 50px;
    font-family: sans-serif;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--color-primary-hover);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius: 8px;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    color: var(--color-primary-hover);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* -----------------------------
   АДАПТИВНОСТЬ (MOBILE FIRST ПОДХОД К ПЕРЕОПРЕДЕЛЕНИЮ DESKTOP СТИЛЕЙ)
   ----------------------------- */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.8rem;
    }

    .burger {
        display: flex;
        /* Показываем бургер только на мобильных */
    }

    /* Мобильное меню выезжает слева */
    .nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--bg-main);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: left 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        /* Плавный эффект отскока */
    }

    .nav.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }

    .nav-link {
        font-size: 1.8rem;
    }

    /* Сбрасываем Flexbox колонки для цен и футера в один ряд (столбиком) */
    .hero-grid {
        flex-direction: column;
        gap: 20px;
    }

    .hero-img {
        width: 80%;
    }

    .pricing-cards {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .footer-socials {
        justify-content: center;
    }
}