/* =========================
   Tablet
========================= */

@media (max-width: 1024px) {
    .why {
        padding: 72px 40px;
    }

    .why-shell {
        gap: 40px;
        padding: 42px;
    }

    .why-content h2 {
        margin-bottom: 26px;
        font-size: 34px;
    }

    .why-description {
        margin-bottom: 22px;
        font-size: 14px;
    }

    .why-feature {
        padding: 13px 0;
    }

    .why-feature h3 {
        font-size: 15px;
    }

    .why-feature p {
        font-size: 13px;
    }

    .machines {
        padding: 80px 40px;
    }

    .machines-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .machine-modal-content {
        padding: 45px 34px;
    }

    .machine-modal-title {
        font-size: 26px;
    }

    .machine-modal-image-wrap {
        padding: 20px;
    }

    .machine-modal-image {
        max-width: 96%;
        max-height: 460px;
    }
}


/* =========================
   Mobile
========================= */

@media (max-width: 768px) {

    /* Header */

    .header {
        height: 90px;
        padding: 0 18px;
    }

    .logo img {
        width: 60px;
    }

    .menu-toggle {
        display: block;

        position: relative;
        z-index: 1002;
    }

    .header nav {
        display: flex;

        width: 100%;
        height: 100vh;
        height: 100dvh;

        position: fixed;
        inset: 0;
        z-index: 1001;

        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 26px;

        background: var(--color-surface);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(-12px);

        transition:
            opacity var(--transition-base),
            visibility var(--transition-base),
            transform var(--transition-base);
    }

    .header nav.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .mobile-menu-logo {
        display: block;
        margin-bottom: 18px;
    }

    .mobile-menu-logo img {
        display: block;
        width: 95px;
        height: auto;
        margin: 0 auto;
    }

    .header nav a {
        width: auto;

        padding: 4px 14px;

        border: 0;

        color: var(--color-text);

        font-size: 23px;
        font-weight: 700;
        text-align: center;

        opacity: 0;
        transform: translateY(12px);

        transition:
            color 0.25s ease,
            opacity 0.35s ease,
            transform 0.35s ease;
    }

    .header nav.open a {
        opacity: 1;
        transform: translateY(0);
    }

    .header nav.open a:nth-of-type(1) {
        transition-delay: 0.05s;
    }

    .header nav.open a:nth-of-type(2) {
        transition-delay: 0.10s;
    }

    .header nav.open a:nth-of-type(3) {
        transition-delay: 0.15s;
    }

    .header nav.open a:nth-of-type(4) {
        transition-delay: 0.20s;
    }

    .header nav.open a:nth-of-type(5) {
        transition-delay: 0.25s;
    }

    .header nav a:hover {
        color: var(--color-primary);
        transform: none;
    }

    .language-toggle {
        min-width: 120px;
        margin-top: 4px;
        padding: 9px 18px;
        font-size: 14px;
    }


    /* Hero */

    .hero {
        display: block;

        min-height: auto;

        padding: 0;

        background-image: none;

        text-align: center;
    }

    .hero > .hero-content {
        display: none;
    }

    .mobile-hero {
        display: block;
        background: var(--color-surface);
    }

    .mobile-hero-image {
        display: block;

        width: 100%;
        height: 190px;

        object-fit: cover;
        object-position: center;
    }

    .mobile-hero-content {
        padding: 28px 20px 38px;
    }

    .mobile-hero h1 {
        margin-bottom: 12px;

        color: var(--color-text);

        font-size: 24px;
        font-weight: 800;
        line-height: 1.45;
    }

    .mobile-hero p {
        max-width: 330px;

        margin: 0 auto 22px;

        color: var(--color-text-muted);

        font-size: 13px;
        line-height: 1.9;
    }

    .mobile-hero .btn {
        padding: 10px 27px;
        font-size: 14px;
    }


    /* Why */

    .why {
        padding: 52px 20px;
    }

    .why-shell {
        display: flex;
        flex-direction: column;
        gap: 0;

        padding: 0;

        background: transparent;
        border: 0;
        border-radius: 0;
    }

    .why-content {
        display: contents;
    }

    .why-content h2 {
        order: 1;
        align-self: center;

        margin-bottom: 38px;

        font-size: 27px;
        line-height: 1.4;
        text-align: center;
        white-space: nowrap;
    }

    .why-content h2::after {
        width: 58px;
        margin: 10px auto 0;
    }

    .why-image {
        order: 2;
        width: 100%;
        margin-bottom: 28px;
    }

    .why-image img {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9.2;

        border-radius: 12px;
    }

    .why-description {
        order: 3;

        margin-bottom: 30px;

        font-size: 14px;
        line-height: 2;
        text-align: center;
    }

    .why-features {
        order: 4;
        width: 100%;
        gap: 12px;
    }

    .why-feature {
        gap: 13px;

        padding: 17px 16px;

        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.035);
    }

    .why-feature:last-child {
        border-bottom: 1px solid var(--color-border);
    }

    .why-check {
        flex-basis: 34px;
        width: 34px;
        height: 34px;

        font-size: 20px;
    }

    .why-feature h3 {
        margin-bottom: 2px;

        font-size: 15px;
        line-height: 1.6;
    }

    .why-feature p {
        font-size: 13px;
        line-height: 1.7;
    }


    /* Services */

    .services {
        padding: 50px 20px;
    }

    .services h2 {
        margin-bottom: 35px;
        font-size: 28px;
    }

    .services-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .service-card {
        width: 100%;
    }


    /* Machines */

    .machines {
        padding: 55px 20px;
    }

    .machines-heading {
        margin-bottom: 24px;
    }

    .machines-heading h2 {
        font-size: 28px;
    }

    .machines-heading p {
        font-size: 13px;
    }

    .machine-filters {
        gap: 8px;
        margin-bottom: 30px;
    }

    .machine-filter {
        min-width: auto;
        padding: 8px 15px;
        font-size: 12px;
    }

    .machines-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .machine-card-body {
        padding: 20px;
    }

    .machine-card-body h3 {
        font-size: 19px;
    }

    .machine-card-body p {
        min-height: auto;
        font-size: 13px;
    }

    .machines-actions {
        margin-top: 30px;
        padding: 32px 20px;
    }

    .machines-action-copy {
        padding: 0;
    }

    .machines-action-copy h3 {
        font-size: 22px;
    }

    .machines-action-copy p {
        margin-bottom: 22px;
        font-size: 13px;
        line-height: 1.9;
    }

    .catalog-button {
        width: 100%;
        min-width: 0;
    }


    /* Machine Modal */

    .machine-modal {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: var(--radius-lg);
    }

    .machine-modal-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .machine-modal-image-wrap {
        min-height: 300px;
        padding: 20px;
    }

    .machine-modal-image {
        max-width: 92%;
        max-height: 270px;
    }

    .machine-modal-content {
        padding: 30px 22px 26px;
    }

    .machine-modal-close {
        width: 38px;
        height: 38px;

        top: 12px;
        left: 12px;

        font-size: 23px;
    }

    .machine-modal-label {
        margin-bottom: 9px;
        font-size: 12px;
    }

    .machine-modal-title {
        margin-bottom: 14px;
        font-size: 23px;
        line-height: 1.5;
    }

    .machine-modal-description {
        margin-bottom: 22px;
        font-size: 13px;
        line-height: 1.9;
    }

    .machine-modal-features-wrap {
        margin-bottom: 24px;
        padding-top: 20px;
    }

    .machine-modal-features-wrap h4 {
        font-size: 15px;
    }

    .machine-modal-features li {
        font-size: 13px;
    }

    .machine-modal-contact {
        width: 100%;
    }


    /* Contact */

    .contact {
        padding: 50px 20px;
    }

    .contact h2 {
        font-size: 28px;
    }

    .contact-container {
        flex-direction: column;
        gap: 18px;
    }

    .contact-card {
        width: 100%;
    }
}


/* =========================
   Reduced Motion
========================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
