/* Responsive Design */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2.4rem;
    }
    
    .project-row {
        gap: 40px;
    }
    
    .project-image {
        height: 450px;
    }
    
    .project-content h3 {
        font-size: 2rem;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .project-image {
        height: 300px !important; /* Исправить с 400px на 300px */
        min-height: 300px;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .navbar-collapse.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: 12px 15px !important;
        margin-bottom: 5px;
    }
    
    .hero-section {
        background-attachment: scroll;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 30px;
    }
    
    .stat-item {
        flex: 0 0 calc(50% - 15px);
    }
    
    .project-item {
        margin-bottom: 80px;
    }
    
    .project-row {
        flex-direction: column;
        min-height: auto;
        gap: 40px;
    }
    
    .project-image-col,
    .project-content-col {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .project-image {
        height: 400px;
    }
    
    .project-content {
        padding: 0;
    }
    
    .project-content h3 {
        font-size: 1.8rem;
    }
    
    .project-stats {
        gap: 30px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .quick-actions {
        bottom: 20px;
        right: 20px;
    }
    
    .scroll-to-top {
        bottom: 20px;
        left: 20px;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .products-section .row > div {
        margin-bottom: 20px;
    }
    
    .product-card {
        margin-bottom: 20px;
    }

    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-actions .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }
    
    .brand-text {
        display: none;
    }
    
    .project-item {
        margin-bottom: 60px;
    }
    
    .project-image {
        height: 300px;
    }
    
    .project-content h3 {
        font-size: 1.6rem;
    }
    
    .project-features {
        padding: 20px;
    }
    
    .project-stats {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .stat {
        flex: 0 0 calc(33.333% - 15px);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .product-image {
        height: 160px;
    }
    
    .contact-info,
    .contact-form-card,
    .social-section {
        padding: 25px;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    .footer {
        padding: 60px 0 20px;
    }
    
    .footer .row > div {
        margin-bottom: 30px;
    }
    
    .footer-bottom .row > div {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .quick-actions {
        flex-direction: row;
        bottom: 10px;
        right: 10px;
    }
    
    .quick-action {
        width: 50px;
        height: 50px;
    }
    
    .quick-text {
        display: none;
    }
    
    .scroll-to-top {
        bottom: 10px;
        left: 10px;
        width: 45px;
        height: 45px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-image {
        height: 300px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .products-section .row {
        margin-left: -8px;
        margin-right: -8px;
    }
    
    .products-section .col-md-6,
    .products-section .col-lg-3 {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .btn-lg {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .project-item {
        margin-bottom: 50px;
    }
    
    .project-image {
        height: 250px;
    }
    
    .project-content h3 {
        font-size: 1.4rem;
    }
    
    .project-features li {
        font-size: 0.9rem;
        padding-left: 25px;
    }
    
    .project-stats {
        gap: 15px;
    }
    
    .stat {
        flex: 0 0 calc(50% - 10px);
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .service-card,
    .advantage-card,
    .product-card {
        padding: 25px 20px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .notification {
        min-width: 280px;
        right: 15px;
    }
}

/* Mobile menu animation */
.mobile-menu-btn {
    width: 40px;
    height: 40px;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--dark-gray);
    margin: 5px auto;
    transition: all 0.3s ease;
}

.navbar-toggler[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggler[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover {
        transform: none;
    }
    
    .service-card:hover,
    .project-card:hover,
    .advantage-card:hover {
        transform: none;
        box-shadow: var(--box-shadow);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav-link:hover {
        background: none;
    }
    
    .zoom-overlay {
        display: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #FF3300;
        --secondary-color: #0000AA;
        --text-color: #000000;
        --light-bg: #F0F0F0;
        --white: #FFFFFF;
        --dark-gray: #000000;
    }
    
    .btn-primary,
    .btn-secondary {
        border-width: 3px;
    }
    
    .form-control {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-section {
        background-attachment: scroll;
    }
    
    .fade-in {
        animation: none;
        opacity: 1;
    }
    
    .scroll-down,
    .quick-action:hover,
    .scroll-to-top:hover {
        animation: none;
    }
    
    .project-item.scroll-right,
    .project-item.scroll-left {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-actions,
    .contact-form-card,
    .quick-actions,
    .scroll-to-top,
    .footer {
        display: none !important;
    }
    
    .section {
        padding: 20px 0 !important;
        page-break-inside: avoid;
    }
    
    a[href^="#"]::after {
        content: " (" attr(href) ")";
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 20px !important;
        touch-action: manipulation;
    }
    
    .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .quick-action,
    .scroll-to-top {
        min-width: 56px;
        min-height: 56px;
    }
    
    /* Увеличить область клика для интерактивных элементов */
    .service-link,
    .social-link,
    .footer-links a {
        padding: 8px 0;
    }
}

/* Дополнительные стили для корзины на мобильных */
@media (max-width: 768px) {
    /* Корзина в навигации */
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
        top: -6px;
        right: -6px;
    }
    
    /* Модальное окно корзины */
    .cart-item {
        padding: 10px 0;
    }
    
    .cart-item .col-3 {
        max-width: 80px;
    }
    
    .cart-item .col-5 {
        padding-left: 10px;
    }
    
    /* Карточки товаров */
    .product-detail-card {
        margin-bottom: 20px;
    }
    
    .product-detail-image {
        height: 200px;
    }
    
    .product-detail-info {
        padding: 15px;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .quantity-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quantity-btn {
        width: 35px;
        height: 35px;
    }
    
    .quantity-input {
        width: 50px;
        height: 35px;
    }
    
    .add-to-cart-btn {
        font-size: 0.9rem;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .product-detail-image {
        height: 180px;
    }
    
    .spec-item {
        font-size: 0.9rem;
    }
    
    /* Уведомления на мобильных */
    .notification {
        left: 10px;
        right: 10px;
        top: 70px;
        text-align: center;
    }
}

/* Улучшения для касаний на мобильных */
@media (hover: none) and (pointer: coarse) {
    .quantity-btn,
    .add-to-cart-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .cart-item button {
        padding: 8px 12px;
    }
}

/* ===== АДАПТАЦИЯ HERO ===== */

@media (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .hero-stats .stat-card {
        min-width: 100px;
        padding: 14px 20px;
    }
    .hero-stats .stat-number {
        font-size: 2.4rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding-top: 70px;
        min-height: auto;
        padding-bottom: 60px;
    }
    .hero-background-image {
        background-attachment: scroll;
    }
    .hero-title {
        font-size: 2.4rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .hero-actions .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
    .btn-price {
        width: 100%;
        text-align: center;
    }
    .hero-stats {
        gap: 12px;
    }
    .hero-stats .stat-card {
        flex: 1 1 calc(33.333% - 12px);
        min-width: 80px;
        padding: 14px 12px;
    }
    .hero-stats .stat-number {
        font-size: 2rem;
    }
    .hero-stats .stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-stats .stat-card {
        flex: 1 1 100%;
        max-width: 140px;
        margin: 0 auto;
    }
    .hero-stats {
        gap: 10px;
    }
}