* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: #f9f9f7;
    color: #4a5345;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Главное фото с лепестками */
.main-photo {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-image: url('02.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(180, 189, 170, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.invitation-text {
    color: #3a4235;
    max-width: 90%;
    z-index: 2;
}

.names {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.7);
}

.ampersand {
    font-family: 'Marck Script', cursive;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #637257;
    margin: 0 10px;
}

.date-location {
    margin: 2rem 0;
    font-size: clamp(1rem, 3vw, 1.4rem);
}

.date, .location {
    margin: 0.8rem 0;
    font-weight: 400;
}

.date i, .location i {
    margin-right: 10px;
    color: #768b7a;
}

.quote {
    font-family: 'Marck Script', cursive;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: #4a5345;
    margin: 2.5rem 0;
    line-height: 1.4;
    margin-top: -1rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: gentleBounce 2s infinite;
    cursor: pointer;
    z-index: 3;
}

.scroll-indicator i {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #637257;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.scroll-indicator:hover i {
    opacity: 1;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0) translateX(-50%); }
    50% { transform: translateY(-8px) translateX(-50%); }
}

/* ========== БЛОКИ С РАСТВОРЕНИЕМ ФОТО ========== */
.section-bg {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    width: 100%;
    margin-top: -80px; /* Поднимаем блок на 80px для наложения */
    overflow: hidden;
}

/* СЛОЙ 1: Текущее фото блока */
.section-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* СЛОЙ 2: Предыдущее фото (растворяется в текущем) */
.section-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160px; /* Зона растворения 160px */
    background-image: var(--prev-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    
    /* Градиент прозрачности для растворения */
    mask-image: linear-gradient(
        to bottom,
        rgba(0,0,0,1) 0%,      /* Полностью видно вверху */
        rgba(0,0,0,0.9) 10%,   /* Почти полностью видно */
        rgba(0,0,0,0.7) 25%,   /* Начинаем растворять */
        rgba(0,0,0,0.5) 40%,   /* Наполовину видно */
        rgba(0,0,0,0.3) 55%,   /* Почти не видно */
        rgba(0,0,0,0.1) 70%,   /* Едва видно */
        rgba(0,0,0,0) 85%      /* Полностью растворилось */
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.9) 10%,
        rgba(0,0,0,0.7) 25%,
        rgba(0,0,0,0.5) 40%,
        rgba(0,0,0,0.3) 55%,
        rgba(0,0,0,0.1) 70%,
        rgba(0,0,0,0) 85%
    );
}

/* Контентные блоки */
.message-content,
.timeline,
.dress-content,
.rsvp-content,
.contacts-content {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    width: 100%;
    max-width: 800px;
    margin: 40px auto 0; /* Отступ сверху чтобы не попадал в зону растворения */
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* ========== ТЕКСТ ПРИГЛАШЕНИЯ ========== */
.message-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #4a5345;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.message-text {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    line-height: 1.6;
    text-align: center;
}

.message-text p {
    margin-bottom: 1.2rem;
    color: #4a5345;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.signature {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(180, 189, 170, 0.5);
}

.signature-names {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #637257;
    margin-top: 0.5rem;
}

/* ========== ЗАГОЛОВКИ СЕКЦИЙ ========== */
h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

h2 i {
    color: #879d90;
    font-size: clamp(1.2rem, 3vw, 1.4rem);
}

/* ========== РАСПИСАНИЕ ========== */
.timeline {
    margin-top: 1.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    max-width: 750px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(180, 189, 170, 0.5);
}

.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-time {
    min-width: 70px;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 500;
    color: #637257;
    padding-right: 1rem;
    font-family: 'Playfair Display', serif;
}

.timeline-content h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #4a5345;
    margin-bottom: 0.4rem;
}

.timeline-content p {
    color: #4a5345;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* ========== ДРЕСС-КОД ========== */
.dress-content {
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 750px;
}

.dress-intro {
    text-align: center;
    font-size: clamp(1.2rem, 2.5vw, 1.2rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.dress-guidelines {
    background-color: rgba(212, 215, 200, 0.3);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.guideline {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 15px;
}

.guideline:last-child {
    margin-bottom: 0;
}

.guideline i {
    color: #879d90;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-top: 3px;
    min-width: 25px;
}

.guideline p {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #4a5345;
    margin-bottom: 0;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* ========== ПОДТВЕРЖДЕНИЕ ========== */
.rsvp-content {
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 600px;
}

.rsvp-intro {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* ========== КОНТАКТЫ ========== */
.contacts-content {
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 800px;
}

.contacts-intro {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.contact-card {
    background-color: rgba(255, 255, 255, 0.95);
    padding: clamp(1.2rem, 2.5vw, 1.8rem);
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-icon {
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    background-color: rgba(180, 189, 170, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.contact-icon i {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #637257;
}

.contact-info h3 {
    font-size: clamp(1.2rem, 2.8vw, 1.4rem);
    color: #4a5345;
    margin-bottom: 0.5rem;
    text-align: center;
}

.contact-info p {
    color: #4a5345;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    text-align: center;
}

.phone, .address {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #768b7a;
    margin-top: 0.5rem;
}

/* Формы */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.form-group {
    margin-bottom: 1rem;
    width: 100%;
}

input, select, textarea {
    width: 100%;
    padding: 14px 12px;
    border: 1px solid rgba(180, 189, 170, 0.7);
    border-radius: 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    background-color: rgba(255, 255, 255, 0.95);
    color: #4a5345;
    transition: all 0.3s;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #879d90;
    box-shadow: 0 0 0 2px rgba(135, 157, 144, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-note {
    background-color: rgba(212, 215, 200, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.2rem 0;
    text-align: center;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #4a5345;
}

.form-note i {
    color: #879d90;
    margin-right: 8px;
}

.submit-btn {
    width: 100%;
    padding: 14px 12px;
    background: linear-gradient(to right, #a2ac94, #879d90);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.1rem, 2.8vw, 1.3rem);
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.submit-btn:hover {
    background: linear-gradient(to right, #879d90, #768b7a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 114, 87, 0.2);
}

.form-message {
    margin-top: 1.2rem;
    padding: clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 8px;
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    display: none;
    background-color: rgba(180, 189, 170, 0.3);
    border: 1px solid rgba(162, 172, 148, 0.5);
    color: #4a5345;
}

/* ========== ФУТЕР ========== */
footer {
    background-color: rgba(180, 189, 170, 0.15);
    padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 2vw, 1.5rem);
    text-align: center;
    border-top: 1px solid rgba(180, 189, 170, 0.3);
    /*margin-top: -80px; /* Компенсируем поднятие блока контактов */
    width: 100%;
    position: relative;
    z-index: 2;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
}

.footer-quote {
    font-family: 'Marck Script', cursive;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.footer-names {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 1.5rem 0;
}

.footer-names .name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: #637257;
}

.footer-names .heart {
    color: #879d90;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.wedding-date {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #768b7a;
    margin-top: 1rem;
}

.floral-border {
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(180, 189, 170, 0.3),
        rgba(162, 172, 148, 0.5),
        rgba(180, 189, 170, 0.3)
    );
    margin-top: 2rem;
    border-radius: 2px;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
    }
    
    .contact-cards {
        flex-direction: row;
        justify-content: center;
    }
    
    .contact-card {
        flex: 1;
        max-width: 300px;
    }
}

@media (max-width: 767px) {
    .section-bg {
        margin-top: -60px; /* Меньше наложение на мобильных */
    }
    
    .section-bg::after {
        height: 120px; /* Меньше зона растворения */
    }
    
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        margin: 30px auto 0;
        padding: 1.5rem;
        width: 100%;
    }
    
    footer {
        margin-top: -60px;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-time {
        padding-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .guideline {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .guideline i {
        margin-bottom: 5px;
    }
    
    footer {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 400px) {
    .section-bg {
        margin-top: -40px;
        padding: 1rem 0.8rem;
    }
    
    .section-bg::after {
        height: 80px;
    }
    
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        margin: 20px auto 0;
        padding: 1.2rem;
    }
    
    footer {
        margin-top: -40px;
    }
    
    input, select, textarea {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 12px 10px;
    }
    
    .footer-names {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-names .heart {
        transform: rotate(90deg);
    }
}

/* iOS фикс */
@media screen and (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

.map-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #879d90;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 15px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.map-button:hover {
    background-color: #637257;
    transform: translateY(-2px);
    color: white;
}

/* Для планшетов и ПК - центрируем кнопку и делаем уже */
@media (min-width: 768px) {
    .map-button {
        width: auto;  /* Убираем ширину 100% */
        min-width: 200px;  /* Минимальная ширина */
        margin-left: auto;  /* Центрирование */
        margin-right: auto;  /* Центрирование */
        display: flex;  /* Оставляем flex для центрирования содержимого */
    }
}

.message-photo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.message-photo img {
    width: 100%;
    max-width: 250px;  /* Оставляем как было для мобильных */
    height: auto;
    border-radius: 4px;  
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* ТОЛЬКО ДЛЯ ПЛАНШЕТОВ И ПК - увеличиваем фото */
@media (min-width: 768px) {
    .message-photo img {
        max-width: 350px;  /* Увеличили только на планшетах и ПК */
    }
}

/* ДЛЯ БОЛЬШИХ ЭКРАНОВ (ПК) - еще больше */
@media (min-width: 1200px) {
    .message-photo img {
        max-width: 450px;  /* Еще больше на больших мониторах */
    }
}

/* ========== FIX: Убираем размытие в эмуляции DevTools ========== */
/* Эта проблема возникает только при эмуляции мобильных устройств в DevTools */
/* На реальных устройствах всё отображается корректно */

@media (-webkit-device-pixel-ratio: 2), (device-pixel-ratio: 2) {
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
    }
}

/* Дополнительная защита для всех эмулируемых устройств */
@media only screen and (pointer: coarse) and (hover: none) {
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }
}

/* Исправление для конкретно iPhone 12 в DevTools */
@media only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) {
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
    }
}


/* ========== КНОПКА УПРАВЛЕНИЯ МУЗЫКОЙ (БЕЗ БЛЮРА) ========== */
.music-control {
    position: absolute;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.music-btn {
    background: rgba(255, 255, 255, 0.95);  /* Убрали backdrop-filter, оставили чистый фон */
    border: 1px solid rgba(180, 189, 170, 0.8);
    border-radius: 60px;
    padding: 14px 32px;
    cursor: pointer;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
    color: #4a5345;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
    /* Убрали backdrop-filter полностью */
}

.music-btn i {
    font-size: 1.2rem;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 1);  /* Полностью непрозрачный при наведении */
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.music-text {
    font-weight: 600;
}

/* Адаптация для планшетов */
@media (max-width: 768px) {
    .music-control {
        bottom: 140px;
    }
    
    .music-btn {
        padding: 12px 28px;
        font-size: 1.1rem;
    }
    
    .music-btn i {
        font-size: 1.1rem;
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 480px) {
    .music-control {
        bottom: 120px;
    }
    
    .music-btn {
        padding: 10px 24px;
        font-size: 1rem;
        gap: 8px;
    }
    
    .music-btn i {
        font-size: 1rem;
    }
}

/* ========== УБИРАЕМ СИНЕЕ ВЫДЕЛЕНИЕ ПРИ НАЖАТИИ НА МОБИЛЬНЫХ ========== */

/* Убираем подсветку при нажатии на все кнопки и интерактивные элементы */
button,
.btn,
.submit-btn,
.music-btn,
.map-button,
.scroll-indicator,
[role="button"],
input[type="submit"],
input[type="button"] {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    outline: none !important;
}

/* Убираем синий фон при нажатии на кнопки в Safari/iOS */
button:focus,
.btn:focus,
.submit-btn:focus,
.music-btn:focus,
.map-button:focus,
button:active,
.btn:active,
.submit-btn:active,
.music-btn:active,
.map-button:active {
    outline: none !important;
    background-color: transparent !important;
}

/* Специально для кнопки музыки - убираем синее выделение */
.music-btn {
    -webkit-tap-highlight-color: transparent !important;
}

/* Для кнопки отправки формы */
.submit-btn {
    -webkit-tap-highlight-color: transparent !important;
}

/* Для карты и всех ссылок */
a,
.map-button {
    -webkit-tap-highlight-color: transparent !important;
}

/* Для всех интерактивных элементов */
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent !important;
}

/* Дополнительная защита для iOS */
@media (hover: none) and (pointer: coarse) {
    button,
    .music-btn,
    .submit-btn,
    .map-button {
        -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
        -webkit-tap-highlight-color: transparent !important;
    }
}
