/* ===== RESPONSIVE DESIGN ===== */

/* ===== Large Desktops ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ===== Large Screens ===== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }
    
    .section-title {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }
    
    .pdf-preview {
        min-width: 300px;
    }
}

/* ===== Tablets ===== */
@media (max-width: 992px) {
    .section-padding {
        padding: 4rem 0;
    }
    
    .hero-slider {
        min-height: 600px;
        max-height: 100vh;
    }

    .carousel-item {
        min-height: 600px;
        max-height: 100vh;
        background-attachment: scroll !important;
    }
    
    .carousel-content {
        padding: 80px 1rem 50px;
        position: absolute;
    }
    
    .slide-title {
        font-size: clamp(2.5rem, 6vw, 4.5rem);
    }
    
    .slide-description {
        font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    }
    
    .slide-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .settore-card,
    .prodotto-card {
        padding: 2rem;
    }
    
    .logos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .partner-logos .row {
        gap: 2rem;
    }
    
    .rd-feature {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .contact-item i {
        margin-top: 0;
    }
    
    .pdf-preview {
        flex-direction: column;
        text-align: center;
        min-width: auto;
        gap: 1rem;
    }
    
    .news-image {
        height: 200px;
    }
    
    .news-content {
        padding: 1.5rem;
    }
    
    .news-content h4 {
        font-size: 1.2rem;
    }
    
    #azienda .col-lg-6:first-child {
        margin-bottom: 0;
        padding-right: 2rem;
    }
}

/* ===== Small Tablets & Large Phones ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    /* Использование CSS переменной для реальной высоты viewport */
    .hero-slider {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
    }
    
    .carousel-item {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
        background-attachment: scroll !important;
    }
    
    .carousel-content {
        padding: 60px 1rem 90px;
        position: absolute;
    }
    
    .slide-title {
        font-size: clamp(2.5rem, 6vw, 4.5rem);
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .slide-description {
        font-size: clamp(1.1rem, 2.5vw, 1.4rem);
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .slide-actions {
        gap: 1rem;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .carousel-control-prev {
        left: 15px;
    }
    
    .carousel-control-next {
        right: 15px;
    }
    
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: scale(1.1);
    }
    
    .carousel-indicators {
        bottom: 75px;
    }
    
    .carousel-indicators [data-bs-target] {
        width: 10px;
        height: 10px;
    }
    
    .section-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
    
    .settore-card,
    .prodotto-card {
        padding: 1.5rem;
    }
    
    .settore-icon,
    .prodotto-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-bottom .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .news-image {
        height: 180px;
    }
    
    .news-content {
        padding: 1.25rem;
    }
    
    .news-content h4 {
        font-size: 1.1rem;
    }
    
    .news-date {
        top: 0.75rem;
        right: 0.75rem;
        min-width: 50px;
    }
    
    .news-date .day {
        font-size: 1.2rem;
    }
    
    .news-date .month {
        font-size: 0.7rem;
    }
}

/* ===== Mobile Phones ===== */
@media (max-width: 576px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .section-padding {
        padding: 2rem 0;
    }
    
    .hero-slider {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
    }
    
    .carousel-item {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
        background-attachment: scroll !important;
    }
    
    .carousel-content {
        padding: 50px 1rem 85px;
        position: absolute;
    }
    
    .slide-title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
        line-height: 1.1;
    }
    
    .slide-description {
        font-size: clamp(1rem, 4.5vw, 1.3rem);
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
        line-height: 1.5;
    }
    
    .slide-actions {
        gap: 1rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 35px;
        height: 35px;
        bottom: 15px;
    }
    
    .carousel-control-prev {
        left: 10px;
    }
    
    .carousel-control-next {
        right: 10px;
    }
    
    .carousel-indicators {
        bottom: 70px;
    }
    
    .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    
    .section-title {
        font-size: clamp(1.3rem, 3.5vw, 2rem);
    }
    
    .settore-card,
    .prodotto-card {
        padding: 1rem;
    }
    
    .settore-icon,
    .prodotto-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .quick-contact {
        padding: 1.5rem;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .contact-details .contact-item {
        padding: 0.75rem;
    }
    
    .news-content {
        padding: 1rem;
    }
    
    .news-content h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .news-content p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .news-link {
        font-size: 0.8rem;
    }
}

/* ===== Small Mobile Phones ===== */
@media (max-width: 480px) {
    .hero-slider {
        height: 100vh;
        min-height: 100vh;
    }
    
    .carousel-item {
        height: 100vh;
        min-height: 100vh;
    }
    
    .carousel-content {
        padding: 50px 0.75rem 65px;
        position: absolute;
    }
    
    .slide-title {
        font-size: clamp(1.7rem, 7vw, 2.5rem);
    }
    
    .slide-description {
        font-size: clamp(0.95rem, 4vw, 1.2rem);
    }
    
    .slide-actions .btn {
        font-size: 0.8rem;
        padding: 0.7rem 1.2rem;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-contact-info .contact-item {
        justify-content: center;
        text-align: center;
    }
    
    .news-content h4 {
        font-size: 0.85rem;
    }
    
    .news-content p {
        font-size: 0.8rem;
    }
}

/* ===== Very Small Screens ===== */
@media (max-width: 360px) {
    .hero-slider {
        height: 100vh;
        min-height: 100vh;
    }
    
    .carousel-item {
        height: 100vh;
        min-height: 100vh;
    }
    
    .carousel-content {
        padding: 50px 0.75rem 65px;
        position: absolute;
    }
    
    .slide-title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }
    
    .slide-description {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    }
    
    .carousel-indicators {
        bottom: 55px;
    }
    
    .carousel-indicators [data-bs-target] {
        width: 6px;
        height: 6px;
        margin: 0 2px;
    }
    
    .scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .news-image {
        height: 150px;
    }
    
    .news-content {
        padding: 0.75rem;
    }
    
    .news-content h4 {
        font-size: 0.9rem;
    }
    
    .news-date {
        top: 0.5rem;
        right: 0.5rem;
        min-width: 45px;
        padding: 0.25rem;
    }
    
    .news-date .day {
        font-size: 1rem;
    }
    
    .news-date .month {
        font-size: 0.6rem;
    }
}

/* ===== ACCESSIBILITY & SPECIAL CASES ===== */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .carousel-item {
        background-attachment: scroll !important;
    }
    
    section::after {
        display: none !important;
    }
    
    .section-separator::before {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-red: #ff0000;
        --white: #ffffff;
        --black: #000000;
        --dark-gray: #222222;
    }
    
    .image-placeholder {
        border-style: solid;
        border-width: 3px;
    }
    
    .logo-placeholder {
        border-style: solid;
        border-width: 3px;
    }
    
    section::after {
        height: 4px;
    }
    
    .section-separator::before {
        height: 5px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    :root {
        --black: #000000;
        --dark-gray: #0f0f0f;
        --gray: #1a1a1a;
    }
}

/* Print styles */
@media print {
    .navbar,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators,
    .scroll-to-top,
    .loading-overlay,
    .scroll-progress {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section-title,
    .slide-title,
    .footer-links h4 {
        color: black !important;
    }
    
    .highlight {
        color: #d82b2b !important;
        -webkit-text-fill-color: #d82b2b !important;
    }
    
    .btn-custom-primary,
    .btn-custom-secondary {
        border: 1px solid #d82b2b;
        color: #d82b2b !important;
        background: none !important;
    }
    
    .settore-card,
    .prodotto-card,
    .contact-item,
    .feature-item,
    .news-card {
        border: 1px solid #ccc;
        background: none;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .hero-slider {
        height: auto;
        min-height: auto;
    }
    
    .carousel-item {
        position: static;
        height: auto;
        min-height: auto;
        background: none !important;
    }
    
    .carousel-overlay {
        display: none;
    }
    
    .slide-content {
        position: static;
        padding: 2rem 0;
    }
    
    section::after {
        display: none !important;
    }
    
    .section-separator::before {
        display: none !important;
    }
}