:root {
    --primary-pink: #ff9a9e;
    --primary-soft: #fad0c4;
    --secondary-lavender: #c7b9ff;
    --secondary-mint: #a8e6cf;
    --bg-light: #fff9f9;
    --bg-white: #ffffff;
    --text-soft: #5f4b5f;
    --text-light: #8b7b8b;
    --shadow-soft: 0 20px 40px rgba(255, 154, 158, 0.1);
    --shadow-hover: 0 30px 50px rgba(199, 185, 255, 0.2);
    --gradient-romantic: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 50%, #c7b9ff 100%);
    --gradient-soft: linear-gradient(135deg, #fff5f5 0%, #f8f0ff 100%);
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Quicksand', sans-serif;
    --radius-card: 30px;
    --radius-iphone: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-soft);
    line-height: 1.6;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

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

/* Прелоадер */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff5f5, #f8f0ff);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-heart {
    font-size: 50px;
    color: var(--primary-pink);
    animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
}

/* Навигация */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.glass {
    background: rgba(255, 249, 249, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 154, 158, 0.2);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 600;
}

.logo-icon {
    font-size: 28px;
    animation: float 3s ease infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    color: var(--text-soft);
}

.logo-text span {
    color: var(--primary-pink);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-soft);
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link:hover {
    color: var(--primary-pink);
}

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

.nav-cta {
    background: var(--gradient-romantic);
    color: white !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-soft);
    margin: 3px 0;
    transition: all 0.3s ease;
}

/* Hero секция */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 100px 0 50px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    font-size: 40px;
    opacity: 0.5;
    animation: float-slow 20s infinite linear;
}

.flower-1 {
    top: 20%;
    left: 10%;
    animation: float-slow 15s infinite;
}

.flower-2 {
    bottom: 20%;
    right: 10%;
    animation: float-slow 18s infinite reverse;
}

.flower-3 {
    top: 40%;
    right: 15%;
    animation: float-slow 12s infinite;
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(5deg); }
    50% { transform: translate(20px, 0) rotate(10deg); }
    75% { transform: translate(10px, 15px) rotate(5deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeInUp 1s ease;
    margin-bottom: 40px; /* Добавляем отступ снизу */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 154, 158, 0.1);
    border-radius: 50px;
    font-size: 14px;
    color: var(--primary-pink);
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 60px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-soft);
}

.gradient-text {
    background: var(--gradient-romantic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 50px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-romantic);
    color: white;
    box-shadow: 0 10px 20px rgba(255, 154, 158, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 154, 158, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-pink);
    color: var(--primary-pink);
}

.btn-outline:hover {
    background: var(--primary-pink);
    color: white;
    transform: translateY(-3px);
}

.btn-primary i, .btn-outline i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i, .btn-outline:hover i {
    transform: translateX(5px);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
    margin-bottom: 30px; /* Добавляем отступ снизу */
    position: relative;
    z-index: 3; /* Поднимаем выше */
}


.stat-item {
    text-align: center;
    backdrop-filter: blur(5px);
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.1);
}

.stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-pink);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    letter-spacing: 1px;
}

.scroll-indicator {
    position: absolute;
    bottom: 20px; /* Уменьшаем отступ снизу */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}

.scroll-text {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--primary-pink), transparent);
    margin: 0 auto;
    animation: scrollLine 2s ease infinite;
}

@keyframes scrollLine {
    0% { transform: scaleY(0.3); opacity: 0; }
    50% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(0.3); opacity: 0; }
}

/* Шаблоны */
.templates {
    padding: 100px 0;
    background: var(--gradient-soft);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-subtitle {
    display: inline-block;
    font-size: 14px;
    color: var(--primary-pink);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-soft);
}

.section-description {
    font-size: 16px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.templates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Жестко 2 колонки */
    gap: 30px;
    width: 100%;
    max-width: 100%;
}

.template-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.template-card.visible {
    padding-top: 20px;
    opacity: 1;
    transform: translateY(0);
}

.template-card-inner {
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.template-card-inner:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.template-card:hover .iphone-screen img {
    transform: scale(1.05);
}

.template-info {
    padding: 20px;
}
.custom-phone-frame {
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 9 / 16; /* Соотношение сторон как у телефона */
}

.frame-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none; /* Чтобы клики проходили сквозь рамку к контенту */
    z-index: 2;
}

.frame-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%; /* Подберите процент под вашу рамку */
    height: 98%; /* Подберите процент под вашу рамку */
    overflow: hidden;
    z-index: 1;
    border-radius: 24px;
}

.template-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.template-card:hover .template-screenshot {
    transform: scale(1.05);
}

/* Адаптация для разных размеров экрана */
@media (max-width: 768px) {
    .scroll-indicator {
        margin-top:20px;

    }
    .custom-phone-frame {
        max-width: 100%;
    }
    
    .frame-content {
        width: 82%; /* Может потребоваться подстройка */
        height: 98%;
    }
}

@media (max-width: 480px) {
    .frame-content {
        width: 80%; /* Подстройка для маленьких экранов */
        height: 98%;
    }
}

/* Если нужно точное позиционирование под вашу рамку, 
   добавьте корректировки для конкретного изображения */
.custom-phone-frame[data-frame="custom"] .frame-content {
    top: 51%;
    width: 83%;
    height: 91%;
}

.template-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.badge-number {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-pink);
    background: rgba(255, 154, 158, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
}

.badge-popular {
    font-size: 11px;
    color: #ffb347;
    background: rgba(255, 179, 71, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
}

.template-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-soft);
}

.template-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--text-light);
}

.template-meta i {
    color: var(--primary-pink);
    margin-right: 5px;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price-label {
    font-size: 12px;
    color: var(--text-light);
}

.price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-pink);
}

.btn-template {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 154, 158, 0.1);
    border-radius: 50px;
    text-decoration: none;
    color: var(--primary-pink);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-template:hover {
    background: var(--primary-pink);
    color: white;
}

.btn-template i {
    transition: transform 0.3s ease;
}

/* Отзывы */
.reviews {
    padding: 100px 0;
    background: var(--bg-white);
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.review-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.review-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.review-card-inner {
    background: linear-gradient(135deg, #fff5f5, #fff9f9);
    padding: 30px;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 154, 158, 0.2);
}

.review-card-inner:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.review-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.review-couple-photo {
    position: relative;
    width: 70px;
    height: 70px;
}

.bride-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-pink);
}

.couple-heart {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 25px;
    height: 25px;
    background: var(--primary-pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border: 2px solid white;
}

.review-couple-info h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-soft);
}

.wedding-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-light);
}

.wedding-date i {
    color: var(--primary-pink);
}

.review-content {
    position: relative;
    margin-bottom: 20px;
    padding-left: 20px;
}

.quote-icon {
    position: absolute;
    left: -10px;
    top: -10px;
    font-size: 40px;
    color: var(--primary-pink);
    opacity: 0.2;
}

.review-text {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.8;
    font-style: italic;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(255, 154, 158, 0.3);
    padding-top: 15px;
}

.review-rating {
    color: #ffd700;
}

.review-date {
    font-size: 12px;
    color: var(--text-light);
}

/* Контакты */
.contacts {
    padding: 100px 0;
    background: var(--gradient-soft);
    position: relative;
    overflow: hidden;
}

.contacts-wrapper {
    display: grid;
    grid-template-columns: 1fr 0.5fr;
    gap: 60px;
    align-items: center;
}

.section-header.left {
    text-align: left;
    margin-bottom: 30px;
}

.section-header.left .section-description {
    margin: 0;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 154, 158, 0.2);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary-pink);
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.contact-card.telegram .contact-icon {
    background: linear-gradient(135deg, #0088cc, #00aaff);
    color: white;
}

.contact-card.whatsapp .contact-icon {
    background: linear-gradient(135deg, #25D366, #2ecc71);
    color: white;
}

.contact-card.instagram .contact-icon {
    background: linear-gradient(45deg, #f09433, #d62976, #962fbf);
    color: white;
}

.contact-card.email .contact-icon {
    background: linear-gradient(135deg, #4a90e2, #6aa8f0);
    color: white;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 3px;
}

.contact-value {
    font-weight: 600;
    color: var(--text-soft);
}

.contact-arrow {
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.contact-card:hover .contact-arrow {
    transform: translateX(5px);
    color: var(--primary-pink);
}

.contacts-decoration {
    position: relative;
    height: 300px;
}

.decoration-circle {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,154,158,0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 3s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.decoration-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    animation: float 3s ease infinite;
}

/* Footer */
.footer {
    padding: 40px 0;
    background: var(--bg-white);
    border-top: 1px solid rgba(255, 154, 158, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-soft);
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-pink);
}

.footer-copyright {
    font-size: 14px;
    color: var(--text-light);
}

/* Адаптивность */
@media (max-width: 992px) {
    .hero-title {
        font-size: 48px;
    }
    
    .contacts-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .section-header.left {
        text-align: center;
    }
    
    .contacts-decoration {
        display: none;
    }
}

@media (max-width: 768px) {
        .templates-grid {
        grid-template-columns: repeat(2, 1fr); /* Оставляем 2 колонки */
        gap: 15px;
    }
    
    /* Уменьшаем размеры карточек для мобильных */
    .template-card-inner {
        border-radius: 15px;
    }
    
    .iphone-frame {
        max-width: 100%; /* Занимает всю ширину колонки */
        padding: 15px 8px 8px;
    }
    
    .iphone-dynamic-island {
        width: 70px;
        height: 20px;
        top: 8px;
    }
    
    .camera {
        width: 8px;
        height: 8px;
    }
    
    .iphone-screen {
        border-radius: 20px;
    }
    
    .template-info {
        padding: 12px 10px;
    }
    
    .template-name {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .template-meta {
        flex-direction: column;
        gap: 5px;
        margin-bottom: 10px;
    }
    
    .template-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .price-value {
        font-size: 18px;
    }
    
    .btn-template {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 249, 249, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .contact-cards {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
     .templates-grid {
        grid-template-columns: repeat(2, 1fr); /* Держим 2 колонки */
        gap: 10px;
    }
    
    .template-card {
        min-width: 0; /* Предотвращаем переполнение */
    }
    
    .template-info {
        padding: 12px 8px;
    }
    
    .template-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 8px;
    }
    
    .badge-number, .badge-popular {
        font-size: 18px;
        padding: 3px 6px;
    }
    
    .template-name {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .template-meta {
        font-size: 10px;
    }
    
    .template-meta i {
        font-size: 10px;
        margin-right: 3px;
    }
    
    .price-label {
        font-size: 10px;
    }
    
    .price-value {
        font-size: 16px;
    }
    
    .btn-template {
        padding: 6px 10px;
        font-size: 12px;
        gap: 5px;
    }
    
    .btn-template i {
        font-size: 10px;
    }
}
@media (max-width: 360px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr); /* Всё ещё 2 колонки */
        gap: 8px;
    }
    
    .template-name {
        font-size: 12px;
    }
    
    .price-value {
        font-size: 14px;
    }
    
    .btn-template {
        padding: 5px 8px;
        font-size: 11px;
    }
}