/* Responsive Design - Адаптивный дизайн ТРОН */

/* Breakpoints */
/* xs: 0px - 575px */
/* sm: 576px - 767px */
/* md: 768px - 991px */
/* lg: 992px - 1199px */
/* xl: 1200px - 1399px */
/* xxl: 1400px+ */

/* Mobile First Approach */
/* Base styles for mobile devices (xs) */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .product-card {
        margin-bottom: 20px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
    }
    
    .hero-stats {
        flex-direction: row;
        justify-content: center;
    }
    
    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .news-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-split {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        align-items: center;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .main-header .container {
        flex-wrap: nowrap;
    }
    
    .search-container {
        order: 0;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra extra large devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
}

/* Mobile-specific styles (max-width: 767px) */
@media (max-width: 767px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    /* Spacing */
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    
    /* Header */
    .top-header {
        display: none;
    }
    
    .main-header .container {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .logo {
        font-size: 28px;
    }
    
    .catalog-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        max-width: none;
    }
    
    .header-icons {
        gap: 10px;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Navigation */
    .main-nav {
        display: none;
    }
    
    /* Hero */
    .hero {
        min-height: 80vh;
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .hero-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
        margin-top: 2rem;
    }
    
    .hero-stat-number {
        font-size: 2rem;
    }
    
    /* Cards */
    .product-card {
        margin-bottom: 20px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .promo-card {
        padding: 20px;
        min-height: 150px;
    }
    
    .promo-title {
        font-size: 20px;
    }
    
    .promo-discount {
        font-size: 36px;
    }
    
    .news-card {
        height: 250px;
        margin-bottom: 20px;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .contact-form {
        padding: 20px;
    }
    
    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 8px;
        border-right-width: 1px;
        margin-bottom: 5px;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Grid */
    .row {
        margin: 0 -10px;
    }
    
    .col {
        padding: 0 10px;
    }
    
    /* Footer */
    .footer {
        padding: 30px 0 20px;
    }
    
    .footer-content {
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 30px;
    }
    
    .footer-section:last-child {
        margin-bottom: 0;
    }
    
    .footer-right {
        text-align: center;
    }
    
    .footer-left {
        text-align: center;
    }
}

/* Tablet-specific styles (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-right {
        text-align: right;
    }
    
    .footer-left {
        text-align: left;
    }
}

/* Desktop-specific styles (992px+) */
@media (min-width: 992px) {
    .hero-split {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        align-items: center;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-right {
        text-align: right;
    }
    
    .footer-left {
        text-align: left;
    }
}

/* Large desktop-specific styles (1200px+) */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-right {
        text-align: right;
    }
    
    .footer-left {
        text-align: left;
    }
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    .no-print {
        display: none !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img,
    .product-image,
    .news-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 100vh;
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        margin-bottom: 1.5rem;
    }
    
    .hero-stats {
        margin-top: 1.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --tron-white: #1a1a1a;
        --tron-text: #ffffff;
        --tron-dark-gray: #cccccc;
        --tron-gray: #2a2a2a;
    }
    
    body {
        background-color: var(--tron-white);
        color: var(--tron-text);
    }
    
    .card {
        background-color: #2a2a2a;
        border-color: #333;
    }
    
    .form-control {
        background-color: #2a2a2a;
        border-color: #555;
        color: var(--tron-text);
    }
    
    .form-control:focus {
        background-color: #333;
        border-color: var(--tron-blue);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    /* Отключаем любые псевдоэлементы с анимациями во избежание визуальных артефактов */
    *::before,
    *::after {
        animation: none !important;
        transform: none !important;
    }
}

/* Focus visible for better accessibility */
@media (prefers-reduced-motion: no-preference) {
    .focus-visible:focus {
        outline: 2px solid var(--tron-blue);
        outline-offset: 2px;
    }
}

/* Promotional Slider Responsive Styles */
@media (max-width: 768px) {
    .slider-item {
        flex: 0 0 195px;
        height: 250px;
    }
    
    .slider-item.active {
        flex: 0 0 300px;
        height: 250px;
    }
    
    .slider-nav {
        width: 40px;
        height: 40px;
    }
    
    .slider-prev {
        left: -20px;
    }
    
    .slider-next {
        right: -20px;
    }
    
    .promo-icons {
        gap: 10px;
    }
    
    .promo-icons i {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .slider-item {
        flex: 0 0 156px;
        height: 200px;
    }
    
    .slider-item.active {
        flex: 0 0 240px;
        height: 200px;
    }
    
    .slider-track {
        gap: 10px;
    }
    
    .slider-nav {
        display: none;
    }
}

/* Business Section Responsive Styles */
@media (min-width: 992px) {
    .business-main-card {
        padding: 50px;
    }
    
    .business-title {
        font-size: 32px;
    }
    
    .business-subtitle {
        font-size: 22px;
    }
    
    .business-illustration {
        width: 250px;
        height: 250px;
    }
}

@media (min-width: 1200px) {
    .business-main-card {
        padding: 60px;
    }
    
    .business-title {
        font-size: 36px;
    }
    
    .business-subtitle {
        font-size: 24px;
    }
    
    .business-illustration {
        width: 280px;
        height: 280px;
    }
}

/* Адаптивные стили для блока брендов */
@media (max-width: 768px) {
    .brand-slider-container-full {
        padding: 30px 0;
    }
    
    .brand-item {
        flex: 0 0 220px;
        min-width: 220px;
    }
    
    .brand-item .category-card {
        padding: 20px;
        height: 140px;
    }
    
    .brand-item .category-card img {
        max-height: 90px;
    }
}

@media (max-width: 480px) {
    .brand-slider-container-full {
        padding: 20px 0;
    }
    
    .brand-item {
        flex: 0 0 180px;
        min-width: 180px;
    }
    
    .brand-item .category-card {
        padding: 15px;
        height: 110px;
    }
    
    .brand-item .category-card img {
        max-height: 70px;
    }
    
    .brand-track {
        gap: 20px;
    }
}