/* ===== ОБЩИЙ ОПЫТ: ФОН, МОБИЛЬНАЯ ПАНЕЛЬ, ЗВОНКИ ===== */

:root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --mobile-bar-h: 64px;
    --tel-color: #6B3A1F;
    --tel-gold: #D4AF37;
}

/* --- Люксовый анимированный фон (CSS-only, GPU) --- */
.luxury-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(165deg, #FFFCF8 0%, #FDF8F0 40%, #F7F1E8 100%);
}

.luxury-bg__orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    filter: blur(50px);
}

.luxury-bg__orb--1 {
    width: min(70vw, 420px);
    height: min(70vw, 420px);
    top: -8%;
    right: -12%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04) 70%);
    animation: orbFloat1 22s ease-in-out infinite;
}

.luxury-bg__orb--2 {
    width: min(55vw, 340px);
    height: min(55vw, 340px);
    bottom: 15%;
    left: -15%;
    background: radial-gradient(circle, rgba(107, 58, 31, 0.1), transparent 70%);
    animation: orbFloat2 28s ease-in-out infinite;
}

.luxury-bg__orb--3 {
    width: min(40vw, 260px);
    height: min(40vw, 260px);
    top: 45%;
    right: 5%;
    background: radial-gradient(circle, rgba(243, 229, 171, 0.25), transparent 70%);
    animation: orbFloat3 18s ease-in-out infinite;
}

.luxury-bg__grain {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 25px) scale(1.05); }
    66% { transform: translate(20px, -15px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-20px, 20px); }
    75% { transform: translate(15px, -25px); }
}

/* --- Ссылки tel: --- */
a[href^="tel:"],
.tel-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.tel-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: inherit;
    font-weight: 500;
    transition: color 0.2s;
}

.tel-link:hover,
.tel-link:active {
    color: var(--tel-gold, #D4AF37);
}

.tel-link--gold {
    color: var(--tel-gold, #D4AF37);
}

/* --- Кнопка звонка в шапке (мобильная) --- */
.btn-phone-header {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37 0%, #F3E5AB 100%);
    color: #562816;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-phone-header:active {
    transform: scale(0.94);
}

/* --- Нижняя мобильная панель действий --- */
.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(255, 252, 248, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding: 0.5rem 1rem calc(0.5rem + var(--safe-bottom));
    box-shadow: 0 -8px 32px rgba(44, 36, 26, 0.08);
}

.mobile-action-bar__inner {
    display: flex;
    gap: 0.6rem;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-action-bar__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-action-bar__btn:active {
    transform: scale(0.97);
}

.mobile-action-bar__btn--call {
    background: linear-gradient(135deg, #6B3A1F 0%, #9C5D32 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(107, 58, 31, 0.3);
}

.mobile-action-bar__btn--call i {
    animation: phonePulse 2s ease-in-out infinite;
}

.mobile-action-bar__btn--secondary {
    background: white;
    color: #6B3A1F;
    border: 1.5px solid rgba(107, 58, 31, 0.2);
}

@keyframes phonePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* --- Плавающая кнопка звонка (дополнительно на планшетах) --- */
.call-fab {
    display: none;
    position: fixed;
    bottom: calc(1.25rem + var(--safe-bottom));
    left: 1.25rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37 0%, #F3E5AB 100%);
    color: #562816;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.45);
    z-index: 98;
    transition: transform 0.25s;
    -webkit-tap-highlight-color: transparent;
}

.call-fab:active {
    transform: scale(0.92);
}

/* --- Блок быстрого звонка в hero --- */
.hero-call-strip {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    width: fit-content;
    max-width: 100%;
}

.hero-call-strip a {
    font-weight: 600;
    color: var(--tel-color, #6B3A1F);
    font-size: 0.95rem;
    white-space: nowrap;
}

.hero-call-strip span {
    font-size: 0.75rem;
    color: #6B6258;
}

/* --- Утилиты touch --- */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-luxury,
    .filter-btn,
    .nav-link,
    .product-card,
    .store-item {
        -webkit-tap-highlight-color: transparent;
    }

    .product-card:hover {
        transform: none;
    }

    .product-card:active {
        transform: scale(0.98);
        transition: transform 0.15s;
    }
}

/* --- Мобильные брейкпоинты --- */
@media (max-width: 992px) {
    .has-mobile-bar {
        padding-bottom: calc(var(--mobile-bar-h) + var(--safe-bottom) + 1rem) !important;
    }

    .mobile-action-bar {
        display: block;
    }

    .back-to-top,
    .call-fab {
        bottom: calc(var(--mobile-bar-h) + var(--safe-bottom) + 0.75rem);
    }
}

@media (max-width: 768px) {
    .btn-phone-header {
        display: flex;
    }

    .hero-call-strip {
        display: flex;
    }

    .header-content {
        gap: 12px !important;
    }

    .header-actions-desktop {
        display: none !important;
    }

    /* Горизонтальный скролл фильтров */
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .filter-buttons {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.4rem !important;
        padding-bottom: 0.25rem;
        margin: 0 -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
        min-height: 44px;
        padding: 0.55rem 1.1rem !important;
    }

    .view-btn {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    /* Модалка — bottom sheet на мобильных */
    .modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-content,
    .modal-content-wide {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        border-radius: var(--radius-xl, 28px) var(--radius-xl, 28px) 0 0 !important;
        padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom)) !important;
        animation: sheetSlideUp 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .close {
        width: 44px;
        height: 44px;
        top: 0.75rem;
        right: 0.75rem;
    }

    .btn-contact {
        width: 100%;
        justify-content: center;
        min-height: 52px;
        font-size: 1rem;
    }

    .product-price-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .btn-details {
        width: 100%;
        min-height: 44px;
        text-align: center;
    }

    .catalog-cta {
        padding: 2.5rem 1.25rem !important;
        margin-left: -4px;
        margin-right: -4px;
        border-radius: var(--radius-lg, 20px) !important;
    }

    .catalog-cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .catalog-cta-actions .btn-luxury {
        width: 100%;
        justify-content: center;
        min-height: 52px;
    }

    .catalog-hero-title br {
        display: none;
    }
}

@media (max-width: 480px) {
    .catalog-stats {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem !important;
    }

    .catalog-stat-num {
        font-size: 1.5rem !important;
    }

    .catalog-stat-label {
        font-size: 0.6rem !important;
        letter-spacing: 1px !important;
    }

    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .mobile-action-bar__btn {
        font-size: 0.8rem;
        padding: 0.55rem 0.75rem;
    }

    .hero-title br {
        display: none;
    }

    .category-pill {
        font-size: 0.72rem;
        padding: 0.35rem 0.9rem;
    }

    .advantages-carousel-wrapper {
        padding: 0 12px !important;
    }

    .carousel-arrow {
        width: 40px !important;
        height: 40px !important;
    }

    .carousel-arrow.prev { left: -4px; }
    .carousel-arrow.next { right: -4px; }
}

@media (min-width: 769px) and (max-width: 992px) {
    .call-fab {
        display: flex;
    }
}

@keyframes sheetSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .luxury-bg__orb,
    .mobile-action-bar__btn--call i {
        animation: none !important;
    }

    .modal-content {
        animation: none !important;
    }
}

/* body lock при модалке */
body.modal-open {
    overflow: hidden;
    touch-action: none;
}
