/**
 * bobroff.pro — responsive_v2.css
 * Mobile-first breakpoints: sm(640px), md(768px), lg(1024px), xl(1280px)
 * PREMIUM EDITION — адаптив под новые стили
 */

/* ========================================
   sm: 640px+
   ======================================== */
@media (min-width: 640px) {
    :root {
        --container-padding: var(--space-6);
    }

    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hero-title {
        font-size: var(--text-5xl);
    }

    .cta-actions {
        flex-direction: row;
        justify-content: center;
    }

    .calculator-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo-img {
        width: 48px;
        height: 48px;
    }

    /* Улучшенные стат-карточки на tablet */
    .hero-stat {
        padding: var(--space-5) var(--space-6);
    }

    .hero-stat-value {
        font-size: var(--text-4xl);
    }
}

/* ========================================
   md: 768px+
   ======================================== */
@media (min-width: 768px) {
    :root {
        --container-padding: var(--space-8);
    }

    h1 { font-size: var(--text-5xl); }
    h2 { font-size: var(--text-4xl); }
    h3 { font-size: var(--text-2xl); }

    .section {
        padding-top: var(--space-20);
        padding-bottom: var(--space-20);
    }

    .header-spacer {
        height: 80px;
    }

    .header-container {
        height: 80px;
    }

    .mobile-menu {
        top: 80px;
    }

    .main-nav {
        display: block;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .hero-title {
        font-size: var(--text-6xl);
    }

    .hero-text {
        font-size: var(--text-xl);
    }

    .hero-stats {
        gap: var(--space-8);
    }

    .hero-stat-value {
        font-size: var(--text-4xl);
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }

    .cta-title {
        font-size: var(--text-4xl);
    }

    .calculator-form {
        padding: var(--space-12);
    }

    .layers-container {
        grid-template-columns: 1fr 1fr;
    }

    .step-item {
        padding-left: var(--space-20);
    }

    /* Улучшенная FAQ на tablet+ */
    .faq-question {
        padding: var(--space-6) var(--space-8);
        font-size: var(--text-lg);
    }

    .faq-answer-inner {
        padding: 0 var(--space-8) var(--space-6);
        font-size: var(--text-base);
    }
}

/* ========================================
   lg: 1024px+
   ======================================== */
@media (min-width: 1024px) {
    :root {
        --container-padding: var(--space-10);
    }

    .header-actions {
        display: flex;
    }

    /* Projects — 3 колонки */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Features — 4 колонки */
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Testimonials — 3 колонки */
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Blog — 3 колонки */
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .projects-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }

    .hero-content {
        max-width: 680px;
    }

    /* Calculator — 3 колонки */
    .calculator-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .modal {
        padding: var(--space-10);
    }

    /* Улучшенные шаги на десктопе — горизонтальная timeline */
    .steps-timeline {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
        max-width: none;
    }

    .step-item {
        padding-left: 0;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .step-number {
        position: relative;
        margin-bottom: var(--space-4);
        width: 56px;
        height: 56px;
        font-size: var(--text-xl);
    }

    .step-content {
        padding: var(--space-5);
    }

    .step-title {
        font-size: var(--text-lg);
    }

    /* Hero stats — больше отступы */
    .hero-stats {
        gap: var(--space-10);
    }
}

/* ========================================
   xl: 1280px+
   ======================================== */
@media (min-width: 1280px) {
    .hero-content {
        max-width: 720px;
    }

    .section-title {
        font-size: var(--text-4xl);
    }

    /* Улучшенные шаги — 6 в ряд */
    .steps-timeline {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--space-4);
    }

    .step-content {
        padding: var(--space-4);
    }

    .step-title {
        font-size: var(--text-base);
    }

    .step-desc {
        font-size: var(--text-xs);
    }
}

/* ========================================
   Мобильные оптимизации (max-width)
   ======================================== */
@media (max-width: 767px) {
    .comparison-table-wrapper {
        margin-left: calc(var(--container-padding) * -1);
        margin-right: calc(var(--container-padding) * -1);
        border-radius: 0;
    }

    .comparison-table {
        font-size: var(--text-xs);
    }

    .comparison-table th,
    .comparison-table td {
        padding: var(--space-3) var(--space-4);
    }

    .logo-img {
        width: 38px;
        height: 38px;
    }

    .logo-name {
        font-size: var(--text-base);
    }

    .logo-suffix {
        font-size: 10px;
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        transform: none;
    }

    .toast {
        width: 100%;
    }

    /* Hero на мобильном — упрощённый */
    .hero-bg img {
        opacity: 0.3;
    }

    .hero-overlay {
        background: linear-gradient(
            to bottom,
            rgba(250, 250, 248, 0.98) 0%,
            rgba(250, 250, 248, 0.95) 100%
        );
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    /* Статистика на мобильном — вертикально */
    .hero-stats {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero-stat {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    /* Калькулятор на мобильном — полная ширина */
    .calculator-form {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }

    .calculator-result {
        padding: var(--space-5);
    }

    .result-value {
        font-size: var(--text-3xl);
    }

    /* FAQ на мобильном */
    .faq-question {
        padding: var(--space-4) var(--space-5);
        font-size: var(--text-sm);
    }

    .faq-answer-inner {
        padding: 0 var(--space-5) var(--space-5);
        font-size: var(--text-sm);
    }

    /* CTA на мобильном */
    .cta-title {
        font-size: var(--text-2xl);
    }

    .cta-phone {
        font-size: var(--text-lg);
    }

    /* Отзывы на мобильном */
    .testimonial-quote {
        font-size: var(--text-lg);
    }

    /* Footer на мобильном — компактнее */
    .footer-grid {
        gap: var(--space-8);
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        text-align: center;
    }

    .footer-legal {
        justify-content: center;
    }
}

/* ========================================
   Sticky bottom bar для мобильного
   ======================================== */
@media (max-width: 767px) {
    .mobile-sticky-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: calc(var(--z-header) - 1);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--color-border);
        padding: var(--space-3) var(--space-4);
        display: flex;
        gap: var(--space-3);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }

    .mobile-sticky-bar .btn {
        flex: 1;
        font-size: var(--text-sm);
        padding: var(--space-3) var(--space-4);
    }

    .mobile-sticky-bar .btn-outline {
        flex: 0 0 auto;
        padding: var(--space-3);
    }

    /* Отступ для контента чтобы не перекрывался баром */
    body:has(.mobile-sticky-bar) {
        padding-bottom: 70px;
    }
}

@media (min-width: 768px) {
    .mobile-sticky-bar {
        display: none;
    }
}

/* ========================================
   Reduced motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in,
    .fade-in-left,
    .scale-in,
    .stagger-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-bg img {
        transform: none !important;
    }
}

/* ========================================
   Dark mode (заготовка)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Пока не применяем, но структура готова */
}

/* ========================================
   Print styles
   ======================================== */
@media print {
    .site-header,
    .site-footer,
    .scroll-top,
    .mobile-menu-toggle,
    .mobile-sticky-bar,
    .btn {
        display: none !important;
    }

    .header-spacer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    .section {
        padding: 2rem 0;
    }
}
