/* =====================================================
   Mery Balloons - Стили v3.0
   ===================================================== */

@import url('fonts/fonts.css');

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fefefe;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


a {
    color: #e87a90;
    text-decoration: none;
}

a:hover {
    color: #d45d73;
}

.container {
    width: min(96vw, 2200px);
    max-width: 2200px;
    margin: 0 auto;
    padding: 0 40px;
}

.container-wide {
    max-width: 100%;
    padding: 0;
}

/* =====================================================
   ШАПКА
   ===================================================== */
.header {
    background: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Верхняя полоса (лого, навигация, иконки). Mega-menu и overlay — соседи снаружи .header-bar,
   чтобы на главной transform при скрытии шапки не ломал position:fixed у мобильного каталога. */
.header-bar {
    width: 100%;
}

/* Для позиционирования mega-menu */
.header-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-family: 'Comfortaa', cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e87a90;
}

.nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #555;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: #e87a90;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e87a90;
}

/* Кнопка Каталог в навигации */
.catalog-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    padding: 8px 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    vertical-align: baseline;
}

/* Главная: сделать кнопки шапки чуть крупнее */
.header--home .nav {
    gap: 30px;
}

.header--home .nav-link {
    font-size: 1.05rem;
    padding: 10px 0;
}

.header--home .catalog-toggle {
    padding: 10px 0;
}

.header--home .icon-btn {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.header--home .btn-small {
    padding: 10px 18px;
    font-size: 0.96rem;
}

.header--home .user-link {
    font-size: 0.98rem;
}

/* =====================================================
   MEGA MENU КАТАЛОГ
   ===================================================== */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-top: 1px solid #f0f0f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    z-index: 99;
}

.header:has(.catalog-toggle:hover) .mega-menu,
.mega-menu:hover,
.mega-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 25px 0;
    justify-content: center;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 25px;
    background: #ffeef2;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mega-menu-item:hover {
    background: #e87a90;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(232, 122, 144, 0.4);
}

.mega-icon {
    font-size: 1.2rem;
}

.mega-title {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .mega-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 98;
    }
    
    .mega-menu-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .mega-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 99;
    }
    
    .mega-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .mega-menu-content {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 15px;
        gap: 10px;
    }
    
    .mega-menu-item {
        justify-content: flex-start;
        padding: 15px 20px;
        font-size: 1rem;
        border-radius: 12px;
    }
}

.header-icons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: #ffeef2;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #e87a90;
    color: #fff;
}

.icon-heart { color: #e87a90; }
.icon-cart { 
    color: #e87a90;
    display: inline-block;
    vertical-align: middle;
    transition: color 0.3s;
}
.icon-btn:hover .icon-heart,
.icon-btn:hover .icon-cart { color: #fff; }

/* SVG корзина - фиолетовые колеса при наведении меняются на белые */
.icon-btn:hover .icon-cart .cart-wheel {
    fill: #fff;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e87a90;
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.hero.hero-photo {
    background: linear-gradient(135deg, #fbe7e2 0%, #f6d7d3 50%, #efc7c5 100%);
    background-color: #f6d7d3;
    min-height: 560px;
    padding: 70px 0 90px;
}

/* Обёртка <picture> и одиночный <img> без WebP — одинаковый кадр на весь блок hero */
.hero.hero-photo .hero-picture {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 116%;
    height: 116%;
    max-width: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}
.hero.hero-photo .hero-picture img.hero-bg-image,
.hero.hero-photo > img.hero-bg-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero.hero-photo > img.hero-bg-image {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 116%;
    height: 116%;
    max-width: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

/* Мягкий розово-молочный градиент слева, чтобы текст был читабелен поверх фото */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        rgba(248, 224, 218, 0.95) 0%,
        rgba(246, 216, 210, 0.85) 35%,
        rgba(243, 205, 200, 0.55) 55%,
        rgba(243, 205, 200, 0.15) 75%,
        rgba(243, 205, 200, 0) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-text {
    max-width: 600px;
    text-align: left;
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-family: 'Comfortaa', cursive;
    font-size: 3.4rem;
    font-weight: 700;
    color: #2b2b2b;
    line-height: 1.1;
    margin-bottom: 22px;
}

.hero-title-accent {
    display: block;
    margin-top: 6px;
    font-style: italic;
    font-weight: 600;
    color: #d97a8c;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #5d5358;
    line-height: 1.55;
    margin-bottom: 32px;
    max-width: 520px;
    animation: fadeInUp 0.8s ease 0.15s both;
}

.hero-buttons,
.intro-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.intro-buttons {
    justify-content: center;
}

.hero-buttons .btn,
.intro-buttons .btn {
    min-width: 220px;
    white-space: nowrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
}

/* "Перейти в каталог" — стиль кнопок из верхнего выпадающего каталога */
.hero-btn-catalog {
    background: #fbe8ec;
    color: #555;
    border: 2px solid #ead3db;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.hero-btn-catalog::before {
    content: none;
}

.hero-btn-catalog .hero-btn-arrow {
    background: rgba(232, 122, 144, 0.14);
    color: #d97a8c;
}

.hero-btn-catalog:hover {
    background: #e87a90;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(232, 122, 144, 0.4);
}

.hero-btn-catalog:hover .hero-btn-arrow {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.hero-btn-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.btn-outline.hero-btn .hero-btn-arrow {
    background: rgba(232, 122, 144, 0.12);
    color: #d97a8c;
}

.hero-btn:hover .hero-btn-arrow {
    transform: translateX(4px);
}

.hero-perks {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 28px;
    margin-top: 44px;
    padding: 0;
    list-style: none;
    animation: fadeInUp 0.8s ease 0.45s both;
}

.hero-perk {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #5a4a4d;
}

.hero-perk + .hero-perk {
    border-left: 1px solid rgba(217, 122, 140, 0.25);
    padding-left: 28px;
}

.hero-perk-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: #d97a8c;
    flex-shrink: 0;
}

.hero-perk-icon svg {
    width: 22px;
    height: 22px;
}

.hero-perk-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    font-size: 0.95rem;
}

.hero-perk-text strong {
    font-weight: 600;
    color: #2b2b2b;
}

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

/* Адаптив hero-секции */
@media (max-width: 1100px) {
    .hero-bg-image {
        object-position: 80% center;
    }
    .hero-overlay {
        background: linear-gradient(
            180deg,
            rgba(248, 224, 218, 0.92) 0%,
            rgba(246, 216, 210, 0.85) 50%,
            rgba(243, 205, 200, 0.4) 100%
        );
    }
    .hero-text {
        max-width: 720px;
    }
}

@media (max-width: 768px) {
    .hero.hero-photo {
        padding: 50px 0 60px;
    }
    .hero-bg-image {
        object-position: center bottom;
    }
    .hero-text {
        text-align: center;
        margin: 0 auto;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-perks {
        justify-content: center;
        gap: 18px;
        margin-top: 30px;
    }
    .hero-perk + .hero-perk {
        border-left: 0;
        padding-left: 0;
    }
    .hero-buttons .btn,
    .intro-buttons .btn {
        min-width: 100%;
    }
}

/* =====================================================
   КНОПКИ
   ===================================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #e87a90, #f5a0b0);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d45d73, #e87a90);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(232, 122, 144, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #fff;
    color: #e87a90;
    border: 2px solid #e87a90;
}

.btn-small:hover {
    background: #e87a90;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e87a90;
    color: #e87a90;
}

.btn-outline:hover {
    background: #e87a90;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e87a90;
    color: #e87a90;
    padding: 10px 20px;
}

.btn-outline:hover {
    background: #e87a90;
    color: #fff;
}

.btn-cart {
    padding: 8px 12px;
    background: #ffeef2;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
}

.btn-cart:hover {
    background: #e87a90;
}

.cart-inline-controls {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #ffeef2;
    border-radius: 10px;
}

.cart-inline-controls.active {
    display: inline-flex;
}

.cart-inline-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #e87a90;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.cart-inline-btn:hover {
    background: #e87a90;
    color: #fff;
}

.cart-inline-count {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
    color: #333;
}

.btn-filter {
    padding: 10px 20px;
    background: #e87a90;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.btn-filter:hover {
    background: #d45d73;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
    width: 100%;
}

/* =====================================================
   СЛАЙДЕР
   ===================================================== */
.slider-section {
    padding: 70px 0;
    background: #fff;
    position: relative;
    z-index: 10;
}

.section-title {
    font-family: 'Comfortaa', cursive;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
}

.occasion-intro {
    padding: 60px 0;
    background: linear-gradient(135deg, #ffeef2 0%, #fff5f0 50%, #f0f7ff 100%);
}

/* =====================================================
   БЛОК "ВЫБЕРИТЕ ПОВОД"
   ===================================================== */
.occasions-section {
    padding: 80px 0;
    background: #fafafa;
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

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

.occasion-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.occasion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(232, 122, 144, 0.2);
}

.occasion-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    overflow: hidden;
    background: #ffeef2;
    position: relative;
}

.occasion-image picture,
.occasion-image > img {
    display: block;
    width: 100%;
    height: 100%;
}

.occasion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
    transition: transform 0.35s ease;
}

.occasion-card:hover .occasion-image img {
    transform: scale(1.12);
}

.occasion-image .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1rem;
}

.occasion-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.occasion-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
    line-height: 1;
}

.occasion-icon {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.occasion-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.occasion-content h3 {
    font-family: 'Comfortaa', cursive;
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 10px;
}

.occasion-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.occasion-btn {
    color: #e87a90;
    font-weight: 600;
    font-size: 0.95rem;
}

.occasion-card:hover .occasion-btn {
    color: #d16278;
}

/* =====================================================
   КАК МЫ РАБОТАЕМ
   ===================================================== */
.how-we-work {
    padding: 80px 0;
    background: #fff;
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

.work-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.work-step {
    text-align: center;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.work-step h3 {
    font-family: 'Comfortaa', cursive;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

.work-step p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* =====================================================
   ПОЧЕМУ НАС ВЫБИРАЮТ
   ===================================================== */
.why-choose-us {
    padding: 80px 0;
    background: #fafafa;
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

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

.benefit-item {
    text-align: center;
    padding: 30px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(232, 122, 144, 0.15);
}

.benefit-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.benefit-item h3 {
    font-family: 'Comfortaa', cursive;
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.benefit-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =====================================================
   БЛОК ДО/ПОСЛЕ (Beer Slider)
   ===================================================== */
.before-after-section {
    padding: 80px 0;
    background: #fff;
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

.before-after-container {
    max-width: 1200px;
    margin: 50px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.before-after-slider-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.before-after-slider-track {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.before-after-slide {
    display: none;
    width: 100%;
}

.before-after-slide.active {
    display: block;
}

.before-after-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e87a90;
    color: #e87a90;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.before-after-nav-btn:hover {
    background: #e87a90;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.before-after-prev {
    left: -25px;
}

.before-after-next {
    right: -25px;
}

.before-after-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.before-after-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.before-after-dot.active {
    background: #e87a90;
    transform: scale(1.3);
}

.beer-slider,
.beer-slider *,
.beer-slider:before,
.beer-slider:after,
.beer-slider *:before,
.beer-slider *:after {
    box-sizing: border-box;
}

.beer-slider {
    display: inline-block;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    touch-action: pan-y pinch-zoom;
}

.beer-slider img,
.beer-slider svg {
    vertical-align: bottom;
}

.beer-slider > img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    z-index: 0;
}

/* Базовый слой «до»: <picture> от render_responsive_image — высота от img (не height:100% от .beer-slider picture) */
.beer-slider > picture {
    display: block;
    width: 100%;
    height: auto;
    z-index: 0;
}

.beer-slider > picture > img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
}

.beer-reveal {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    overflow: hidden;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.35s;
    height: 100%;
}

/* Слой «после»: первый ребёнок — <picture> или <img>; размеры контейнера задаёт BeerSlider.setImgWidth */
.beer-reveal > picture,
.beer-reveal > img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    max-width: none;
    margin: 0;
}

.beer-reveal > picture {
    height: 100%;
}

.beer-reveal picture img,
.beer-reveal > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    max-width: none;
}

.beer-range {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    height: 100%;
    margin: 0;
    left: -1px;
    width: calc(100% + 2px);
    cursor: pointer;
    -webkit-appearance: slider-horizontal !important;
    -moz-appearance: none;
    appearance: slider-horizontal !important;
    opacity: 0;
    -ms-touch-action: pan-x;
    touch-action: pan-x;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.beer-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 300vh;
}

.beer-range::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 300vh;
}

.beer-range::-ms-tooltip {
    display: none;
}

.beer-handle {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
    color: #000;
    background: rgba(255, 255, 255, 0.5);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0);
    transition: background 0.3s, box-shadow 0.3s, opacity 0.5s 0.25s;
}

.beer-handle:before,
.beer-handle:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    border-top: solid 2px;
    border-left: solid 2px;
    transform-origin: 0 0;
}

.beer-handle:before {
    left: 10px;
    transform: rotate(-45deg);
}

.beer-handle:after {
    right: 0;
    transform: rotate(135deg);
}

.beer-range:focus ~ .beer-handle {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.beer-slider[data-beer-label]:after,
.beer-reveal[data-beer-label]:after {
    content: attr(data-beer-label);
    position: absolute;
    top: 1.5rem;
    line-height: 1;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Comfortaa', cursive;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.beer-slider[data-beer-label]:after {
    right: 1.5rem;
    color: #e87a90;
}

.beer-reveal[data-beer-label]:after {
    left: 1.5rem;
    color: #5628EE;
}

.beer-slider[data-beer-label=""]:after,
.beer-reveal[data-beer-label=""]:after {
    content: none;
}

.beer-ready .beer-reveal,
.beer-ready .beer-handle {
    opacity: 1;
}

@media (max-width: 768px) {
    .before-after-section {
        padding: 50px 0;
    }
    
    .before-after-container {
        margin: 30px auto 0;
    }
    
    .before-after-slider-wrapper {
        padding: 0 40px;
    }
    
    .before-after-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .before-after-prev {
        left: 0;
    }
    
    .before-after-next {
        right: 0;
    }
    
    .beer-slider {
        border-radius: 12px;
    }
    
    .beer-handle {
        width: 40px;
        height: 40px;
    }
    
    .beer-handle:before,
    .beer-handle:after {
        width: 8px;
        height: 8px;
    }
    
    .beer-slider[data-beer-label]:after,
    .beer-reveal[data-beer-label]:after {
        top: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .beer-slider[data-beer-label]:after {
        right: 1rem;
    }
    
    .beer-reveal[data-beer-label]:after {
        left: 1rem;
    }
    
    .before-after-dots {
        margin-top: 20px;
    }
}

/* =====================================================
   ОТЗЫВЫ
   ===================================================== */
.reviews-section {
    padding: 80px 0;
    background: #fafafa;
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

.reviews-slider-wrapper {
    position: relative;
    max-width: 900px;
    margin: 50px auto 0;
}

.reviews-slider {
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    position: relative;
}

.reviews-slider-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.reviews-slider-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    display: block;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Широкие скриншоты отзывов: не втискиваем в 100% ширины (текст нечитаем) — натуральный масштаб по высоте + горизонтальный скролл */
.review-item {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    display: block;
    position: relative;
    max-height: min(88vh, 960px);
    min-height: 120px;
    line-height: 0;
    text-align: center;
}

.review-item img {
    display: inline-block;
    vertical-align: top;
    max-height: min(88vh, 960px);
    width: auto;
    height: auto;
    max-width: none;
}

.reviews-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e87a90;
    border-radius: 50%;
    font-size: 24px;
    color: #e87a90;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.reviews-slider-btn:hover {
    background: #e87a90;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.reviews-slider-prev {
    left: -25px;
}

.reviews-slider-next {
    right: -25px;
}

.reviews-slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.reviews-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reviews-slider-dot.active {
    background: #e87a90;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .review-item,
    .review-item img {
        max-height: min(78vh, 720px);
    }

    .reviews-slider-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .reviews-slider-prev {
        left: -20px;
    }
    
    .reviews-slider-next {
        right: -20px;
    }
}

/* =====================================================
   ФИНАЛЬНЫЙ ПРИЗЫВ
   ===================================================== */
/* FAQ SECTION */
.faq-section {
    padding: 80px 0;
    background: #fff;
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.faq-question {
    width: 100%;
    padding: 20px 25px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: #fafafa;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: #e87a90;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 25px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 25px 20px 25px;
}

.faq-answer p {
    margin: 0;
    color: #666;
    line-height: 1.7;
    font-size: 1rem;
}

.final-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, #ffeef2 0%, #fff5f0 50%, #f0f7ff 100%);
    position: relative; /* создает stacking context, чтобы быть выше снега */
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.cta-buttons .btn {
    min-width: 200px;
    white-space: nowrap;
}

/* Пастельно-розовые кнопки для CTA */
.cta-buttons .btn-primary {
    background: linear-gradient(135deg, #ffb6d1, #ffc0d9);
    color: #fff;
    border: 2px solid #ffb6d1;
}

.cta-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #ffa0c7, #ffb6d1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 182, 209, 0.4);
}

.btn-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    overflow: hidden;
    border-radius: 16px;
    touch-action: pan-x;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
}

.slider-slide {
    width: 25%;
    min-width: 25%;
    flex: 0 0 25%;
    padding: 10px;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .slider-slide {
        width: 33.333%;
        min-width: 33.333%;
        flex: 0 0 33.333%;
    }
}

.slider-slide .product-card {
    height: 100%;
    margin: 0;
}

.slider-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e87a90;
    flex-shrink: 0;
    color: #e87a90;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background: #e87a90;
    color: #fff;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background: #e87a90;
    transform: scale(1.2);
}

/* =====================================================
   ПОИСК И ФИЛЬТРЫ
   ===================================================== */
.search-block {
    background: linear-gradient(135deg, #ffeef2, #fff5f0);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
    min-width: 300px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 2px solid #fff;
    border-radius: 30px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #e87a90;
}

.price-filter-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.price-slider-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-slider-values-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: #5628EE;
    white-space: nowrap;
}

.price-slider-dash {
    color: #888;
}

.price-slider-value {
    min-width: 70px;
    font-weight: 700;
    color: #5628EE;
    text-align: right;
}

#priceSlider {
    --active: #5628EE;
    --balloon: var(--active);
    --value: #fff;
    --line: #CDD9ED;
    touch-action: none;
    user-select: none;
    width: 260px;
    max-width: 100%;
    height: 2px;
    border-radius: 1px;
    background: var(--line);
    position: relative;
}

#priceSlider .noUi-connects .noUi-connect {
    background: var(--active);
}

#priceSlider .noUi-base,
#priceSlider .noUi-connects {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

#priceSlider .noUi-origin,
#priceSlider .noUi-connect {
    position: absolute;
    will-change: transform;
    transform-origin: 0 0;
    top: 0;
    left: 0;
    z-index: 1;
}

#priceSlider .noUi-connects {
    overflow: hidden;
    z-index: 0;
    border-radius: 1px;
}

#priceSlider .noUi-handle {
    backface-visibility: hidden;
    position: absolute;
    outline: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    /* noUiSlider держит точку процента на правом крае .noUi-origin —
       центрируем ручку относительно правого края, чтобы корректно работало
       на любой ширине трека (260px на десктопе и 100% на мобиле). */
    right: -20px;
    left: auto;
    top: -19px;
    background: transparent;
    border: none;
    box-shadow: none;
}

#priceSlider .noUi-handle:before,
#priceSlider .noUi-handle:after {
    content: '';
    position: absolute;
    border-radius: 20px;
    transform: scale(var(--s));
    transition: transform 0.3s ease, border-radius 0.3s ease;
}

#priceSlider .noUi-handle:before {
    --s: 0.5;
    background: var(--active);
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
}

#priceSlider .noUi-handle:after {
    --s: 0.2;
    background: #fff;
    left: 2px;
    top: 2px;
    width: 36px;
    height: 36px;
}

#priceSlider .noUi-handle.noUi-active:before {
    --s: 1;
}

#priceSlider .noUi-handle.noUi-active:after {
    --s: 1;
}

#priceSlider .balloon {
    --o: 0;
    --s: 0;
    --y: 0;
    --r: 0deg;
    width: 52px;
    height: 68px;
    pointer-events: none;
    position: absolute;
    z-index: 5;
    left: -26px;
    bottom: 0;
    transform-origin: 50% 100%;
}

#priceSlider .balloon > div {
    width: 52px;
    height: 68px;
    transform-origin: 50% 100%;
    opacity: var(--o);
    transform: scale(var(--s)) translate(0, var(--y)) rotate(var(--r));
    transition: transform 0.4s ease, opacity 0.4s ease;
}

#priceSlider .balloon > div:before,
#priceSlider .balloon > div:after {
    content: '';
    display: block;
}

#priceSlider .balloon > div:before {
    width: 52px;
    height: 52px;
    border-radius: 60%;
    border-bottom-left-radius: 480%;
    border-bottom-right-radius: 480%;
    border-top-left-radius: 480%;
    transform: rotate(135deg);
    background: var(--balloon);
}

#priceSlider .balloon > div:after {
    content: attr(data-value);
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--value);
    position: absolute;
    left: 0;
    right: 0;
    top: 16px;
    line-height: 24px;
    text-align: center;
}

#priceSlider .balloon > div svg {
    display: block;
    width: 8px;
    height: 6px;
    fill: var(--balloon);
    position: absolute;
    left: 22px;
    bottom: 0;
}

#priceSlider .balloon.active {
    --o: 1;
    --s: 1;
    --y: -36px;
}

#priceSlider * {
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#priceSlider.noUi-state-tap .noUi-connect,
#priceSlider.noUi-state-tap .noUi-origin {
    transition: transform 0.3s;
}

.noUi-target {
    border: none;
    box-shadow: none;
}

.noUi-horizontal .noUi-handle {
    border: none;
}



/* Убираем переопределение позиционирования origin - noUiSlider сам управляет этим для диапазона */

.filter-label {
    font-weight: 600;
    color: #555;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 8px 15px;
    border-radius: 15px;
}

.price-input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    text-align: center;
    font-size: 0.95rem;
}

.price-input:focus {
    outline: none;
    border-color: #e87a90;
}

.price-separator {
    color: #999;
}

.search-results {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

/* =====================================================
   КАТЕГОРИИ
   ===================================================== */
.catalog {
    padding: 70px 0;
    background: #f9f9f9;
    position: relative;
    z-index: 10;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.filter-btn:hover {
    border-color: #e87a90;
    color: #e87a90;
}

.filter-btn.active {
    background: #e87a90;
    color: #fff;
}

label.filter-btn.filter-btn-checkbox {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    font: inherit;
}

.filter-btn-checkbox input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.filter-btn-checkbox:has(input:checked),
.filter-btn-checkbox.active {
    background: #e87a90;
    color: #fff;
    border-color: transparent;
}

.catalog-category-hint {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin: 12px 0 6px;
}

/* =====================================================
   КАРТОЧКИ ТОВАРОВ
   ===================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Блок «Вам может понравиться»: auto-fit схлопывает пустые колонки —
   на широких экранах 4 карточки равномерно делят строку без пустоты справа. */
.recommended-products .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Анимация появления карточек */
.products-grid .product-card {
    animation: cardAppear 0.6s ease backwards;
}

.products-grid .product-card:nth-child(1) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.4s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.5s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.6s; }
.products-grid .product-card:nth-child(n+7) { animation-delay: 0.7s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.no-products {
    text-align: center;
    color: #888;
    padding: 40px;
    grid-column: 1 / -1;
}

.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: none;
    box-shadow: 0 25px 50px rgba(232, 122, 144, 0.3);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #ffeef2, #fff5f0);
}

.product-image a,
.product-image picture {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.15);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 1.2rem;
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ccc;
    backdrop-filter: blur(5px);
}

.favorite-btn:hover {
    background: #e87a90;
    color: #fff;
    transform: scale(1.2);
}

.favorite-btn.active {
    background: #e87a90;
    color: #fff;
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    display: inline-block;
    font-size: 0.75rem;
    color: #e87a90;
    background: #ffeef2;
    padding: 4px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.product-name a:hover {
    color: #e87a90;
}

.product-description {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.product-buttons {
    display: flex;
    gap: 8px;
}

/* =====================================================
   КАЛЬКУЛЯТОР (премиум-конфигуратор)
   ===================================================== */
.calc-page {
    background: linear-gradient(180deg, #fff7f6 0%, #fff 70%);
    padding: 40px 0 80px;
}

.calc-container {
    max-width: 1320px;
}

.calc-hero {
    margin-bottom: 28px;
}

.calc-hero-title {
    font-family: 'Comfortaa', cursive;
    font-size: 2.4rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 8px;
}

.calc-hero-subtitle {
    color: #6b6066;
    font-size: 1.05rem;
}

/* ===== Переключатель режима ===== */
.calc-mode-switch {
    display: inline-flex;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #f1d8de;
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 8px 28px rgba(232, 122, 144, 0.08);
    gap: 4px;
    margin-bottom: 32px;
}

.calc-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 999px;
    color: #5a4a4d;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.calc-mode-btn:hover {
    color: #d97a8c;
}

.calc-mode-btn.is-active {
    background: linear-gradient(135deg, #ee8aa0, #f0a5b8);
    color: #fff;
    box-shadow: 0 6px 14px rgba(232, 122, 144, 0.35);
}

.calc-mode-icon {
    font-size: 1.05rem;
}

@media (max-width: 700px) {
    .calc-mode-switch {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        border-radius: 22px;
    }

    .calc-mode-btn {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
        justify-content: center;
        white-space: normal;
        text-align: center;
        padding: 12px 14px;
    }
}

/* ===== Сетка: контент + sticky sidebar ===== */
.calc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: flex-start;
}

.calc-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* ===== Секции (категории) ===== */
.calc-section {
    background: #fff;
    border: 1px solid #f4e3e7;
    border-radius: 24px;
    padding: 26px 26px 28px;
    box-shadow: 0 6px 22px rgba(232, 122, 144, 0.06);
}

.calc-section-head {
    margin-bottom: 22px;
}

.calc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Comfortaa', cursive;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2b2b2b;
}

.calc-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(232, 122, 144, 0.12);
    font-size: 1rem;
}

.calc-section-sub {
    color: #8a7d80;
    font-size: 0.92rem;
    margin-top: 4px;
}

/* ===== Сетка карточек товара ===== */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.calc-card {
    position: relative;
    background: #fff;
    border: 1.5px solid #f3e3e7;
    border-radius: 18px;
    padding: 16px 14px 18px;
    text-align: center;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Секция бабл-шаров: три равные колонки и одинаковая высота карточек в ряду */
.calc-section--bubble .calc-card {
    height: 100%;
    min-height: 0;
}

.calc-section--bubble .calc-card-title {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 2.6em;
}

@media (min-width: 720px) {
    .calc-section--bubble .calc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.calc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(232, 122, 144, 0.14);
}

.calc-card.is-selected {
    border-color: #ee8aa0;
    box-shadow: 0 12px 28px rgba(232, 122, 144, 0.18);
    background: #fff8fa;
}

.calc-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff5f6, #fde6ea);
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-card-media img,
.calc-card-media svg {
    width: 78%;
    height: 78%;
    object-fit: contain;
}

/* responsive_image() оборачивает в <picture>: даём тот же «кадр», что у прямого img */
.calc-card-media picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78%;
    height: 78%;
    margin: 0;
}
.calc-card-media picture img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Бабл «С конфетти»: субъект на фото мельче — слегка приближаем кадр */
.calc-card-media--bubble-close picture {
    width: 92%;
    height: 92%;
}
.calc-card-media--bubble-close img,
.calc-card-media--bubble-close picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
    transform: scale(1.14);
    transform-origin: center center;
}

.calc-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ee8aa0;
    color: #fff;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(232, 122, 144, 0.35);
}

.calc-card.is-selected .calc-card-check {
    opacity: 1;
    transform: scale(1);
}

.calc-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.calc-card-title {
    font-family: 'Comfortaa', cursive;
    font-size: 1rem;
    font-weight: 600;
    color: #2b2b2b;
}

.calc-card-size {
    color: #9a8d90;
    font-size: 0.85rem;
}

.calc-card-price {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    color: #2b2b2b;
    font-size: 1.05rem;
    margin: 6px 0 10px;
}

.calc-card-price--soft {
    color: #8a7d80;
    font-size: 0.92rem;
    line-height: 1.3;
    font-weight: 500;
}

.calc-card-price--soft span {
    color: #2b2b2b;
    font-size: 1.05rem;
    font-weight: 700;
}

.calc-card-price-prefix {
    font-weight: 600;
    color: #7a6d70;
    font-size: 0.92em;
}

.calc-card-price-hint {
    margin: 4px 0 0;
    max-width: 100%;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #8a7d80;
    font-weight: 400;
    text-align: center;
}

/* ===== Кастомный счётчик ===== */
.calc-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    width: 100%;
    background: #fff5f6;
    border: 1px solid #f6dfe5;
    border-radius: 999px;
    padding: 4px;
}

.calc-counter-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #d97a8c;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 6px rgba(217, 122, 140, 0.12);
}

.calc-counter-btn:hover:not(:disabled) {
    background: #ee8aa0;
    color: #fff;
    transform: scale(1.05);
}

.calc-counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calc-counter-val {
    font-weight: 700;
    color: #2b2b2b;
    min-width: 30px;
    text-align: center;
}

.calc-card-request {
    margin-top: auto;
    width: 100%;
    border: none;
    background: transparent;
    color: #d97a8c;
    border: 1.5px solid rgba(232, 122, 144, 0.5);
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.calc-card-request:hover {
    background: #ee8aa0;
    color: #fff;
    border-color: transparent;
}

/* ===== Дополнительные услуги (количество задаёт пользователь) ===== */
.calc-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.calc-extra.calc-extra--qty {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px 18px;
    border: 1.5px solid #f3e3e7;
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: default;
}

.calc-extra.calc-extra--qty:hover {
    border-color: #f0bcc6;
    box-shadow: 0 6px 14px rgba(232, 122, 144, 0.08);
}

.calc-extra.calc-extra--qty.is-active {
    border-color: #ee8aa0;
    background: #fff7fa;
    box-shadow: 0 6px 14px rgba(232, 122, 144, 0.12);
}

.calc-extra.calc-extra--qty .calc-extra-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(232, 122, 144, 0.12);
    color: #d97a8c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calc-extra.calc-extra--qty .calc-extra-icon svg {
    width: 22px;
    height: 22px;
}

.calc-extra-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-extra-name {
    color: #2b2b2b;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

.calc-extra-price-line {
    color: #8a7d80;
    font-size: 0.86rem;
}

.calc-extra-note {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.calc-extra-note span {
    color: #7d7073;
    font-size: 0.8rem;
    font-weight: 600;
}

.calc-extra-note-input {
    width: 100%;
    border: 1.5px solid #f0d9df;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.86rem;
    color: #2b2b2b;
    background: #fff;
    resize: vertical;
    min-height: 52px;
}

.calc-extra-note-input:focus {
    outline: none;
    border-color: #e88ca0;
    box-shadow: 0 0 0 3px rgba(232, 122, 144, 0.12);
}

.calc-extra-counter {
    margin-top: 12px;
    width: 100%;
}

/* ===== Цветовая гамма ===== */
.calc-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.calc-palette-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border: 1.5px solid #f3e3e7;
    background: #fff;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    color: #2b2b2b;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.calc-palette-chip:hover {
    border-color: #f0bcc6;
    transform: translateY(-1px);
}

.calc-palette-chip.is-active {
    border-color: #ee8aa0;
    background: #fff7fa;
}

.calc-palette-swatches {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #fff;
    padding: 2px;
    box-shadow: inset 0 0 0 1px #f1d8de;
}

.calc-palette-swatches span {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-left: -6px;
    box-shadow: 0 0 0 2px #fff;
}

.calc-palette-swatches span:first-child {
    margin-left: 0;
}

.calc-palette-name {
    font-size: 0.92rem;
    font-weight: 500;
}

.calc-comment {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-comment span {
    font-weight: 600;
    color: #2b2b2b;
    font-size: 0.95rem;
}

.calc-comment textarea {
    width: 100%;
    border: 1.5px solid #f3e3e7;
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
    background: #fff;
    color: #2b2b2b;
    resize: vertical;
    min-height: 84px;
    transition: border-color 0.2s;
}

.calc-comment textarea:focus {
    outline: none;
    border-color: #ee8aa0;
}

/* ===== Sticky Sidebar ===== */
.calc-sidebar {
    min-width: 0;
}

.calc-sidebar-sticky {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-summary {
    background: #fff;
    border: 1px solid #f4e3e7;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(232, 122, 144, 0.08);
}

.calc-summary-title {
    font-family: 'Comfortaa', cursive;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 18px;
}

.calc-summary-empty {
    text-align: center;
    padding: 18px 0 24px;
    color: #8a7d80;
}

.calc-summary-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.calc-summary-empty p {
    font-size: 0.92rem;
    line-height: 1.45;
}

.calc-summary-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
}

.calc-summary-group h4 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c98a98;
    margin-bottom: 8px;
}

.calc-summary-line {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed #f1e2e6;
    font-size: 0.92rem;
}

.calc-summary-line:last-child {
    border-bottom: none;
}

.calc-summary-line-name {
    color: #2b2b2b;
}

.calc-summary-line-name small {
    display: block;
    color: #9a8d90;
    font-size: 0.78rem;
    margin-top: 2px;
}

.calc-summary-line-qty {
    color: #9a8d90;
    font-size: 0.85rem;
    white-space: nowrap;
}

.calc-summary-line-price {
    color: #2b2b2b;
    font-weight: 600;
    white-space: nowrap;
}

.calc-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1.5px solid #f4e3e7;
    margin-bottom: 16px;
    font-family: 'Comfortaa', cursive;
}

.calc-summary-total span:first-child {
    font-weight: 600;
    color: #2b2b2b;
    font-size: 1.05rem;
}

.calc-summary-total-value {
    color: #d97a8c;
    font-size: 1.7rem;
    font-weight: 700;
}

.calc-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-add-btn,
.calc-clear-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 999px;
    font-weight: 600;
}

.calc-add-btn svg,
.calc-clear-btn svg {
    width: 20px;
    height: 20px;
}

.calc-clear-btn {
    color: #d97a8c;
    background: #fff;
    border: 1.5px solid rgba(232, 122, 144, 0.4);
}

.calc-clear-btn:hover {
    background: #fff5f7;
}

/* ===== Преимущества ===== */
.calc-perks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: 1px solid #f4e3e7;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(232, 122, 144, 0.05);
}

.calc-perk {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.calc-perk-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(232, 122, 144, 0.12);
    color: #d97a8c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calc-perk-icon svg {
    width: 22px;
    height: 22px;
}

.calc-perk strong {
    display: block;
    color: #2b2b2b;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.calc-perk p {
    color: #8a7d80;
    font-size: 0.86rem;
    line-height: 1.4;
}

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
    .calc-layout {
        grid-template-columns: 1fr;
    }
    .calc-sidebar-sticky {
        position: static;
    }
}

@media (max-width: 640px) {
    .calc-hero-title { font-size: 1.8rem; }
    .calc-section { padding: 22px 18px; }
    .calc-mode-switch { width: 100%; }
    .calc-mode-btn { flex: 0 0 auto; justify-content: center; padding: 12px 14px; font-size: 0.9rem; }
    .calc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   МОДАЛЬНЫЕ ОКНА
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #e87a90;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Корзина */
.cart-items, .favorites-items {
    margin-bottom: 20px;
}

.cart-empty, .favorites-empty {
    text-align: center;
    color: #999;
    padding: 30px;
}

.cart-item, .favorites-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info, .favorites-item-info {
    flex: 1;
}

.favorites-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.favorites-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: pre-line;
}

.cart-item-price {
    color: #e87a90;
    font-weight: 600;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 2px solid #f0f0f0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.qty-btn:hover {
    border-color: #e87a90;
    color: #e87a90;
}

.cart-item-remove, .fav-item-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.cart-item-remove:hover, .fav-item-remove:hover {
    color: #e87a90;
}

.cart-footer {
    border-top: 2px solid #f0f0f0;
    padding-top: 20px;
    display: none;
}

.cart-footer.show {
    display: block;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* =====================================================
   КОНФЕТТИ АНИМАЦИЯ
   ===================================================== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confetti-fall 3s ease-out forwards;
}

.confetti.circle { border-radius: 50%; }
.confetti.square { border-radius: 2px; }
.confetti.rect { width: 8px; height: 16px; border-radius: 2px; }

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg) scale(0.5);
    }
}

/* =====================================================
   УВЕДОМЛЕНИЯ
   ===================================================== */
#notifications,
.notifications {
    position: fixed !important;
    top: 80px !important;
    right: 20px !important;
    z-index: 10000 !important;
    pointer-events: none;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}

#notifications .notification,
.notifications .notification {
    pointer-events: auto;
}

.notification {
    background: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #2ecc71;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =====================================================
   ФУТЕР
   ===================================================== */
.footer {
    background: #333;
    color: #fff;
    padding: 50px 0 25px;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 25px;
}

.footer-col h4 {
    margin-bottom: 15px;
    color: #fff;
}

.footer-col p {
    color: #aaa;
    margin-bottom: 8px;
}

.footer-copy {
    text-align: center;
    color: #666;
    padding-top: 20px;
    border-top: 1px solid #444;
}

/* =====================================================
   СТРАНИЦА ТОВАРА
   ===================================================== */
.main {
    flex: 1;
    padding: 40px 0;
}

.page-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.product-detail-image {
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffeef2, #fff5f0);
    max-width: 700px;
    margin: 0 auto;
}

.product-sku {
    display: inline-block;
    font-size: 0.8rem;
    color: #999;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    margin-right: 10px;
}

.product-detail-image img {
    width: 100%;
    height: 700px;
    object-fit: cover;
    display: block;
}

.product-detail-image-link {
    display: block;
    cursor: zoom-in;
}

.product-detail-image-link picture,
.product-detail-image-link img {
    display: block;
}

.product-detail-image .image-placeholder {
    height: 400px;
}

.product-detail-title {
    font-size: 2rem;
    margin: 10px 0 20px;
}

.product-detail-description {
    color: #555;
    line-height: 1.8;
    margin-bottom: 25px;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: #e87a90;
    margin-bottom: 20px;
}

.product-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.product-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Форма заказа */
.order-form-block {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.form-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 30px;
}

.order-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e87a90;
}

/* Валидация полей */
.form-group input.input-error {
    border-color: #e74c3c;
    background: #fff5f5;
}

.form-group input.input-valid {
    border-color: #27ae60;
    background: #f0fff4;
}

.field-error {
    display: block;
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 5px;
    min-height: 18px;
}

.form-group label small {
    color: #999;
    font-weight: 400;
}

/* Благодарность */
.thanks-block {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.thanks-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.thanks-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.thanks-text {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

/* Контакты */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.contact-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.contact-card h3 {
    margin-bottom: 10px;
}

.contact-card p {
    color: #555;
}

.contact-note {
    font-size: 0.85rem;
    color: #999;
}

.contacts-info {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.order-steps {
    margin-left: 20px;
    margin-bottom: 25px;
}

.order-steps li {
    margin-bottom: 10px;
    color: #555;
}

.delivery-info {
    background: #ffeef2;
    padding: 20px;
    border-radius: 10px;
}

.error-block {
    text-align: center;
    padding: 60px;
}

.error-block h2 {
    color: #e87a90;
    margin-bottom: 20px;
}

/* =====================================================
   АВТОРИЗАЦИЯ
   ===================================================== */
.auth-block {
    max-width: 400px;
    margin: 40px auto;
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .btn {
    width: 100%;
    margin-top: 10px;
}

.auth-error {
    background: #ffe0e0;
    color: #c00;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-success {
    background: #e0ffe0;
    color: #080;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-success--prose {
    text-align: left;
    line-height: 1.55;
    padding: 18px 22px;
}

.auth-success--prose p {
    margin: 0 0 0.65em;
}

.auth-success--prose p:last-child {
    margin-bottom: 0;
}

.auth-success__lead {
    font-weight: 600;
    font-size: 1.06rem;
    color: #063606;
    margin-bottom: 0.55em !important;
}

.auth-links-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

.auth-links-stack .auth-link {
    margin-top: 0;
}

/* Блок после регистрации: адрес, повторная отправка, смена email */
.reg-done {
    text-align: left;
    max-width: 420px;
    margin: 0 auto;
}

.reg-done__lead {
    font-size: 1.35rem;
    font-weight: 700;
    color: #063606;
    margin: 0 0 12px;
}

.reg-done__hint {
    margin: 0 0 18px;
    line-height: 1.55;
    color: #444;
    font-size: 0.98rem;
}

.reg-done__warn {
    text-align: left;
    margin-bottom: 12px;
}

.reg-done__mail-label {
    margin: 0 0 6px;
    font-size: 0.92rem;
    color: #666;
    font-weight: 600;
}

.reg-done__mail {
    margin: 0 0 22px;
    font-size: 1.12rem;
    font-weight: 600;
    color: #222;
    word-break: break-word;
    line-height: 1.45;
    padding: 12px 14px;
    background: #f7f7f9;
    border-radius: 10px;
    border: 1px solid #e8e8ec;
}

.reg-done__actions {
    margin-bottom: 8px;
}

.reg-done__q {
    margin: 16px 0 8px;
    font-size: 0.95rem;
    color: #555;
    font-weight: 600;
}

.reg-done__q:first-of-type {
    margin-top: 0;
}

.reg-done__form {
    margin: 0;
}

.reg-done__btn {
    width: 100%;
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    line-height: 1.3;
}

a.reg-done__btn {
    padding-top: 14px;
    padding-bottom: 14px;
}

.reg-done__login {
    margin-top: 22px;
}

.reg-change-intro {
    margin: 0 0 20px;
    line-height: 1.55;
    color: #444;
}

.verify-resend-pending {
    margin: 0 0 16px;
    line-height: 1.5;
    color: #444;
}

.verify-resend-alt {
    margin-top: 14px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #e87a90;
    font-weight: 600;
}

/* =====================================================
   ПРОФИЛЬ
   ===================================================== */
.user-link {
    color: #333;
    font-weight: 500;
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    position: relative;
    top: 2px;
}

.user-link:hover {
    color: #e87a90;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.profile-card, .orders-card {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.profile-card h2, .orders-card h2 {
    margin-bottom: 25px;
    color: #333;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.orders-empty {
    color: #888;
    margin-bottom: 20px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #e87a90;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.order-id {
    font-weight: 700;
    color: #e87a90;
}

.order-date {
    color: #888;
    font-size: 0.9rem;
}

.order-product {
    margin-bottom: 8px;
}

.order-sku {
    color: #999;
    font-size: 0.85rem;
    margin-left: 10px;
}

.order-address, .order-date-event {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   АДАПТИВНОСТЬ
   ===================================================== */
@media (max-width: 900px) {
    .slider-slide {
        width: 50%;
        min-width: 50%;
        flex: 0 0 50%;
    }
    .contacts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1700px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Шапка: 1-я строка — лого + иконки (без переноса); 2-я — навигация. Сетка держит макет на iPhone mini. */
    .header-content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 8px;
        row-gap: 12px;
        padding: 12px 15px;
    }
    .logo {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        font-size: 1.3rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-icons {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        width: auto;
        max-width: 100%;
    }
    .nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: center;
        gap: 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .nav::-webkit-scrollbar {
        display: none;
    }
    .nav-link,
    .nav .catalog-toggle {
        flex-shrink: 0;
    }
    .nav-link {
        font-size: 0.9rem;
        padding: 6px 0;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .btn-small {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .user-link {
        font-size: 0.85rem;
        margin-right: 0;
    }
    .header-icons .user-link {
        max-width: min(140px, 38vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Внутри .header-icons порядок: избранное → корзина → «Выйти» → «Войти»/«👤 Имя». */
    .header-icons #favoritesBtn {
        order: 1;
    }
    .header-icons #cartBtn {
        order: 2;
    }
    .header-icons .btn-small.btn-outline {
        order: 3;
    }
    .header-icons .user-link,
    .header-icons a.btn-small:not(.btn-outline) {
        order: 4;
    }

    /* Главная на мобильных — та же плотность шапки, что на калькуляторе (без увеличенных .header--home). */
    .header--home .nav {
        gap: 12px;
    }
    .header--home .nav-link {
        font-size: 0.9rem;
        padding: 6px 0;
    }
    .header--home .catalog-toggle {
        padding: 6px 0;
    }
    .header--home .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .header--home .btn-small {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .header--home .user-link {
        font-size: 0.85rem;
    }

    .hero-title {
        font-size: 2rem;
    }
    
    .search-form .btn {
        width: 100%;
        padding: 12px;
    }

    .search-form {
        min-width: 0;
    }

    /* Фильтр по цене на мобильных:
       слайдер на всю ширину, значения переносятся ниже —
       чтобы "10 000 ₽" не вылезал за правый край экрана. */
    .search-form .price-filter-inline {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .search-form .price-slider-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    .search-form #priceSlider {
        width: 100%;
        max-width: 100%;
    }
    .search-form .price-slider-values-inline {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        justify-content: space-between;
        white-space: normal;
        column-gap: 6px;
    }
    .search-form .price-slider-value {
        min-width: 0;
        font-size: 0.9rem;
    }
    .search-form #priceSliderValueMin {
        text-align: left;
    }
    .search-form #priceSliderValueMax {
        text-align: right;
    }

    /* Категории на мобильных */
    .category-filters {
        gap: 8px;
        margin-bottom: 20px;
    }
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    /* Заголовок страницы */
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    /* Слайдер на мобильных */
    .slider-wrapper {
        gap: 5px;
    }
    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    .slider-slide {
        width: 100%;
        min-width: 100%;
        flex: 0 0 100%;
        padding: 10px 5px;
    }
    .slider-slide .product-card {
        margin: 0 auto;
        max-width: 300px;
    }
    
    /* Карточки товаров */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .product-card {
        margin: 0 auto;
        max-width: 100%;
    }
    .product-image {
        height: 280px;
    }
    .product-info {
        padding: 15px;
    }
    .product-name {
        font-size: 1rem;
    }
    .product-description {
        font-size: 0.8rem;
    }
    .product-price {
        font-size: 1.2rem;
    }
    .product-buttons {
        flex-direction: column;
        width: 100%;
    }
    .product-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .product-detail-title {
        font-size: 1.5rem;
    }
    .product-detail-price {
        font-size: 1.6rem;
    }
    .product-actions {
        flex-direction: column;
    }
    .product-actions .btn {
        width: 100%;
    }
    
    .recommended-products {
        margin-top: 50px;
        padding-top: 30px;
    }
    
    .recommended-products .section-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .recommended-products .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Модальные окна на мобильных */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px 15px;
        max-height: 90vh;
    }
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
    }
    .cart-item, .favorites-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    .cart-item-info, .favorites-item-info {
        flex: 1 1 100%;
    }
    .cart-item-qty {
        order: 2;
    }
    .cart-item-remove, .fav-item-remove {
        order: 3;
    }
}

/* Узкие телефоны (iPhone mini и др.): плотнее первая строка шапки — лого + иконки в один ряд. */
@media (max-width: 390px) {
    .header-content {
        column-gap: 4px;
        padding: 10px 12px;
        row-gap: 10px;
    }
    .logo {
        font-size: 1.05rem;
    }
    .header-icons {
        gap: 4px;
    }
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .btn-small {
        padding: 5px 8px;
        font-size: 0.78rem;
    }
    .nav {
        gap: 8px;
    }
    .nav-link {
        font-size: 0.8rem;
    }
    .header--home .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .header--home .btn-small {
        padding: 5px 8px;
        font-size: 0.78rem;
    }
}

/* =====================================================
   CLS / производительность: стабильные размеры до загрузки картинок
   ===================================================== */

/* Carry-over: <picture> внутри карточек должен растягиваться на 100% */
.product-image picture,
.occasion-image picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Отзывы: при variant=original — только <img>; при fallback <picture> — не тянуть на 100%×100% */
.review-item picture {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: none;
    vertical-align: top;
}

/* beer-slider: базовый <picture> — по высоте картинки; overlay — в блоке Beer Slider выше */

/* Калькулятор: <picture> не трогаем — там flex + img 78% / contain (см. блок .calc-card-media выше). */

/* Отзывы: см. секцию «ОТЗЫВЫ» — оригинал + max-height + горизонтальный скролл. */

/* Карточка товара на странице товара (full image): резерв места до загрузки */
.product-detail-image {
    aspect-ratio: 1 / 1;
}
.product-detail-image picture,
.product-detail-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* Hero: фиксированная высота на мобильных, чтобы не «прыгал» текст,
   когда дозагружается фон. */
@media (max-width: 768px) {
    .hero.hero-photo {
        min-height: 480px;
    }
}

/* Снижаем влияние входной анимации карточек на мобильных
   (с translateY анимацией Lighthouse мобильной CPU всё равно медленнее) */
@media (prefers-reduced-motion: reduce) {
    .products-grid .product-card {
        animation: none;
    }
    .hero-text,
    .hero-subtitle,
    .hero-buttons,
    .intro-buttons {
        animation: none;
    }
}

/* =====================================================
   ПРОФИЛЬ — центрирование на мобильной версии
   ===================================================== */
@media (max-width: 768px) {
    /* Имя/email/телефон и формы профиля — с отступами от краёв и центрированы. */
    .profile-card,
    .orders-card {
        text-align: center;
        padding: 20px 18px;
    }
    .profile-card h2,
    .orders-card h2 {
        text-align: center;
    }
    .profile-card .form-group {
        text-align: left;
    }
    .profile-card .form-group label {
        display: block;
        text-align: center;
    }
    .profile-card .profile-form .btn,
    .orders-card .btn {
        display: block;
        margin: 0 auto;
        min-width: 200px;
    }

    /* Карточки статистики (Заказов / Сумма / С нами с) — одна колонка, центр. */
    .profile-stats {
        gap: 14px;
    }
    .profile-stats .stat-card {
        text-align: center;
        padding: 18px 14px;
    }
}

/* =====================================================
   КАЛЬКУЛЯТОР — выравнивание карточек на мобильной версии
   ===================================================== */
@media (max-width: 640px) {
    /* Один и тот же шаблон для всех секций калькулятора:
       2 одинаковые колонки, единая высота карточки и медиа,
       чтобы «Латексные/Хром/Большие» выглядели как «Стандартные/Конфетти». */
    .calc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        align-items: stretch;
        justify-items: stretch;
    }
    .calc-section--bubble .calc-grid {
        /* На мобильном бабл-шары тоже в 2 колонки — последняя карточка займёт всю ширину строки. */
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .calc-card {
        width: 100%;
        min-height: 100%;
        padding: 14px 12px 16px;
        text-align: center;
    }
    .calc-card-media {
        width: 100%;
        aspect-ratio: 1 / 1;
        margin-bottom: 10px;
    }
    .calc-card-media img,
    .calc-card-media picture,
    .calc-card-media svg {
        width: 82%;
        height: 82%;
    }
    .calc-card-title {
        min-height: 2.4em;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .calc-card-body {
        align-items: center;
    }
}
