/* ===== Навигация: жёсткое разведение десктоп/мобайл ===== */

/* Десктоп: горизонтальное меню видно, бургер и оверлей скрыты */
.nav-menu{ display:flex !important; }
.burger-menu{ display:none !important; }
.mobile-menu-overlay{ display:none !important; visibility:hidden !important; opacity:0 !important; }

/* Мобайл ≤768px: бургер виден, горизонтальное меню скрыто */
@media (max-width:768px){
  .nav-menu{ display:none !important; }
  .burger-menu{ display:inline-flex !important; }

  /* По умолчанию оверлей скрыт… */
  .mobile-menu-overlay{ display:none; visibility:hidden; opacity:0; }
  /* …и показывается только с классом .active */
  .mobile-menu-overlay.active{ display:block; visibility:visible; opacity:1; }
}
.nav-container {
        padding: 1rem;
        position: relative;
    }

    .logo {
        font-size: 1.3rem;
    }/* Mobile CSS for Bot Flow */

/* General mobile improvements */
@media (max-width: 768px) {
    /* Show burger menu on mobile instead of regular menu */
    .nav-menu {
        display: none;
    }

    .burger-menu {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        cursor: pointer;
        z-index: 1001;
        transition: all 0.3s ease;
    }

    .burger-line {
        width: 100%;
        height: 3px;
        background: var(--text-primary);
        border-radius: 3px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        transform-origin: center;
    }

    /* Burger animation when active */
    .burger-menu.active .burger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background: var(--accent);
    }

    .burger-menu.active .burger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .burger-menu.active .burger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background: var(--accent);
    }

    /* Mobile Menu Dropdown - show on mobile */
    .mobile-menu-overlay {
        display: block !important;
        position: absolute;
        top: 100%;
        right: 0;
        width: 250px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px) scale(0.95);
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow: hidden;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .mobile-menu {
        padding: 1rem 0;
    }

    .mobile-menu-items {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu-items li {
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active .mobile-menu-items li {
        opacity: 1;
        transform: translateX(0);
    }

    .mobile-menu-items li:nth-child(1) { transition-delay: 0.1s; }
    .mobile-menu-items li:nth-child(2) { transition-delay: 0.2s; }
    .mobile-menu-items li:nth-child(3) { transition-delay: 0.3s; }

    .mobile-nav-link {
        color: var(--text-primary);
        text-decoration: none;
        font-size: 1rem;
        font-weight: 500;
        display: block;
        padding: 0.8rem 1.5rem;
        position: relative;
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-nav-link:last-child {
        border-bottom: none;
    }

    .mobile-nav-link:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--accent-light);
        padding-left: 2rem;
    }

    .mobile-nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 100%;
        background: var(--gradient-primary);
        transition: width 0.3s ease;
    }

    .mobile-nav-link:hover::before {
        width: 3px;
    }

    /* Hero section mobile optimization */
    .hero-content {
        padding: 0 1rem;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 1.5rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.1rem);
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }

    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: auto;
        min-width: 200px;
    }

    .hero-note {
        font-size: 0.8rem;
        padding: 0 1rem;
        text-align: center;
    }

    /* Footer mobile adjustments */
    .footer {
        padding: 2rem 0 1.5rem;
        margin-top: 4rem;
    }

    .footer-content {
        padding: 0 1rem;
        display: block;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 2rem;
    }

    .footer-section:first-child {
        margin-bottom: 2.5rem;
    }

    .footer-section:first-child p {
        max-width: 300px;
        margin: 0 auto 1rem;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .footer-section h3 {
        margin-bottom: 0.8rem;
        font-size: 1rem;
    }

    .footer-section a {
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
        display: inline-block;
        padding: 0.3rem 0.8rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .footer-section a:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--accent-light);
    }

    /* Footer sections reorganization for mobile */
    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        display: inline-block;
        width: 45%;
        vertical-align: top;
        margin: 0 2.5% 1.5rem;
    }

    .footer-section:nth-child(4) {
        clear: both;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border);
    }

    .footer-bottom {
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 0.8rem;
        margin-top: 1rem;
    }

    /* Modal mobile adjustments */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 3% auto;
        padding: 1.5rem;
        max-height: 85vh;
    }

    .modal h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        padding-right: 2rem;
    }

    .modal h3 {
        font-size: 1rem;
        margin: 1rem 0 0.3rem 0;
    }

    .modal p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .modal ul {
        font-size: 0.9rem;
        margin: 0.3rem 0 0.8rem 1rem;
    }

    .modal ul li {
        margin-bottom: 0.3rem;
    }

    .close {
        right: 0.8rem;
        top: 0.8rem;
        font-size: 1.8rem;
    }

    /* Tariff grid mobile */
    .tariff-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .tariff-item {
        padding: 0.8rem;
    }

    .tariff-name {
        font-size: 0.9rem;
    }

    .tariff-price {
        font-size: 1.1rem;
    }

    .tariff-description {
        font-size: 0.85rem;
    }

    /* Button mobile adjustments */
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Loading screen mobile */
    .spinner {
        width: 35px;
        height: 35px;
    }

    /* Hero animation adjustments for mobile */
    .hero::before {
        background: 
            radial-gradient(400px circle at 50% 0%, rgba(59, 130, 246, 0.1), transparent 50%),
            radial-gradient(300px circle at 80% 50%, rgba(29, 78, 216, 0.08), transparent 50%);
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 5vw, 1rem);
    }

    .nav-container {
        padding: 0.8rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .modal-content {
        margin: 2% auto;
        padding: 1rem;
        max-height: 90vh;
    }

    .cta-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        min-width: 180px;
    }

    .footer {
        margin-top: 3rem;
    }

    .tariff-item {
        padding: 0.6rem;
    }

    .tariff-price {
        font-size: 1rem;
    }

    /* Mobile menu adjustments for small screens */
    .mobile-menu-overlay {
        width: 220px;
    }

    .mobile-nav-link {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 6rem 0 4rem;
    }

    .hero-content {
        max-width: 800px;
    }

    .hero-badge {
        margin-bottom: 1rem;
    }

    .hero-title {
        margin-bottom: 0.8rem;
    }

    .hero-subtitle {
        margin-bottom: 1.5rem;
    }

    .modal-content {
        max-height: 75vh;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-link::after {
        display: none;
    }

    .cta-button:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .footer-section a:hover {
        color: var(--accent-light);
    }

    /* Increase touch targets */
    .nav-link {
        padding: 0.5rem 0;
    }

    .close {
        padding: 0.5rem;
        margin: -0.5rem;
    }

    .modal a {
        padding: 0.2rem 0;
        display: inline-block;
    }

    /* Mobile nav touch improvements */
    .mobile-nav-link:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--accent-light);
        padding-left: 1.5rem; /* Less aggressive on touch */
    }
}

/* High DPI mobile screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero::before {
        background-size: 150% 150%;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    /* Ensure sufficient contrast and size for mobile */
    .hero-note {
        line-height: 1.4;
    }

    .modal ul {
        line-height: 1.5;
    }

    .footer-section a {
        line-height: 1.4;
        padding: 0.2rem 0;
    }

    /* Better spacing for readability */
    .modal p {
        line-height: 1.5;
    }

    .tariff-description {
        line-height: 1.4;
    }

    /* Focus states for keyboard navigation */
    .mobile-nav-link:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .burger-menu:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
        border-radius: 4px;
    }
}