/* =========================
   Header Components
========================= */

.logo {
    display: block;
    line-height: 0;
}

.logo img {
    width: 90px;
    height: auto;
}

.header nav a {
    color: var(--color-text);

    font-size: 16px;
    font-weight: 600;
    text-decoration: none;

    transition:
        color var(--transition-base),
        transform var(--transition-base);
}

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

.menu-toggle {
    display: none;

    background: transparent;
    border: 0;

    color: var(--color-text);

    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

.mobile-menu-logo {
    display: none;
}

.language-toggle {
    min-width: 92px;
    padding: 8px 16px;

    border: 1px solid var(--color-border);
    border-radius: 999px;

    background: var(--color-surface);
    color: var(--color-text);

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background-color var(--transition-fast),
        transform var(--transition-fast);
}

.language-toggle:hover {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #ffffff;
    transform: translateY(-1px);
}


/* =========================
   Generic Button
========================= */

.btn {
    display: inline-block;

    padding: 15px 40px;

    background: var(--color-primary);
    color: #ffffff;

    border-radius: var(--radius-sm);

    font-weight: 700;
    text-decoration: none;

    transition:
        background-color var(--transition-base),
        transform var(--transition-base),
        box-shadow var(--transition-base);
}

.btn:hover {
    background: var(--color-text);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

/* Transparency is intentionally limited to the desktop hero CTA.
   The mobile hero CTA and the contact CTA keep the solid primary color. */
.hero-desktop-button {
    background: rgba(189, 32, 46, 0.65);
}


/* =========================
   Hero Typography
========================= */

.hero h1 {
    margin-bottom: 20px;

    font-size: 55px;
    font-weight: 800;
    line-height: 1.4;
}

.hero p {
    margin-bottom: 35px;

    font-size: 20px;
    line-height: 2;
}


/* =========================
   Why Truepack
========================= */

.why-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10.5;
    object-fit: cover;

    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.why-content {
    text-align: start;
}

.why-content h2 {
    position: relative;
    display: inline-block;

    margin-bottom: 34px;

    font-size: 40px;
    font-weight: 800;
    line-height: 1.35;
}

.why-content h2::after {
    content: "";
    display: block;

    width: 64px;
    height: 3px;
    margin-top: 10px;

    background: var(--color-primary);
}

.why-description {
    margin-bottom: 30px;

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

    font-size: 16px;
    line-height: 2;
}

.why-features {
    display: grid;
    gap: 0;
}

.why-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    padding: 16px 0;

    border-bottom: 1px solid var(--color-border);
}

.why-feature:last-child {
    border-bottom: 0;
}

.why-check {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 2px;

    border-radius: 50%;

    background: var(--color-primary);
    color: #ffffff;

    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}

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

    font-size: 17px;
    font-weight: 800;
    line-height: 1.6;
}

.why-feature p {
    color: var(--color-text-muted);

    font-size: 14px;
    line-height: 1.75;
}


/* =========================
   Services
========================= */

.services h2,
.contact h2 {
    font-size: 40px;
    font-weight: 800;
}

.services h2 {
    position: relative;
    margin-bottom: 50px;
}

.services h2::after,
.machines-heading h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 3px;
    background: var(--color-primary);
}

.services h2::after {
    margin: 10px auto 0;
}

.service-card {
    padding: 35px 25px;

    background: var(--color-surface);

    border: 1px solid #dddddd;
    border-radius: var(--radius-md);

    text-align: center;

    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base),
        border-color var(--transition-base);
}

.service-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.icon {
    margin-bottom: 20px;
    color: var(--color-primary);
    font-size: 35px;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 700;
}

.service-card p {
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1.8;
}


/* =========================
   Machines Heading / Filters
========================= */

.machines-heading h2 {
    position: relative;
    display: inline-block;

    margin-bottom: 18px;

    font-size: 40px;
    font-weight: 800;
}

.machines-heading h2::after {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
}

.machines-heading p {
    color: var(--color-text-muted);
    line-height: 1.9;
}

.machine-filter {
    min-width: 110px;

    padding: 10px 22px;

    border: 1px solid #d8d8d8;
    border-radius: 999px;

    background: var(--color-surface);
    color: #333333;

    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.machine-filter:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.machine-filter.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #ffffff;
}


/* =========================
   Machine Card
========================= */

.machine-card {
    overflow: hidden;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-card);

    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base),
        border-color var(--transition-base);
}

.machine-card:hover {
    border-color: rgba(189, 32, 46, 0.45);
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.machine-card[hidden] {
    display: none;
}

.machine-card-image {
    position: relative;

    aspect-ratio: 4 / 3;

    overflow: hidden;

    background: var(--color-surface-muted);
}

.machine-card-image::after {
    content: "";

    position: absolute;
    inset: auto 0 0;

    height: 24%;

    pointer-events: none;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.16),
        transparent
    );
}

.machine-card-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.4s ease;
}

.machine-card:hover .machine-card-image img {
    transform: scale(1.025);
}

.machine-card-body {
    padding: 24px 24px 22px;
}

.machine-card-body h3 {
    margin-bottom: 10px;

    color: var(--color-text);

    font-size: 21px;
    font-weight: 800;
    line-height: 1.55;
}

.machine-card-body p {
    min-height: 58px;

    margin-bottom: 18px;

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

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

.machine-details-link {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding: 0;

    border: 0;

    background: transparent;
    color: var(--color-primary);

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        gap 0.25s ease,
        color 0.25s ease;
}

.machine-details-link:hover {
    gap: 12px;
    color: var(--color-text);
}


/* =========================
   Machines Catalog CTA
========================= */

.machines-actions {
    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.machines-action-copy {
    width: 100%;
    max-width: 780px;

    padding: 10px 20px;

    text-align: center;
}

.machines-action-copy h3 {
    margin-bottom: 12px;

    color: var(--color-text);

    font-size: 27px;
    font-weight: 800;
}

.machines-action-copy p {
    max-width: 680px;

    margin: 0 auto 26px;

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

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

.catalog-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 180px;
    padding: 13px 28px;

    border: 0;
    border-radius: var(--radius-sm);

    background: var(--color-primary);
    color: #ffffff;

    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.catalog-button:hover {
    background: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.14);
}

.catalog-button:focus-visible {
    outline: 3px solid rgba(189, 32, 46, 0.22);
    outline-offset: 3px;
}


/* =========================
   Machine Modal
========================= */

.machine-modal {
    width: min(940px, calc(100% - 40px));
    max-height: calc(100dvh - 40px);

    position: fixed;
    inset: 0;

    margin: auto;
    padding: 0;

    overflow: auto;

    border: 0;
    border-radius: var(--radius-xl);

    background: var(--color-surface);
    color: var(--color-text);

    box-shadow: var(--shadow-modal);
}

.machine-modal::backdrop {
    background: rgba(0, 0, 0, 0.58);

    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.machine-modal[open] {
    animation: machineModalIn 0.22s ease-out;
}

.machine-modal-shell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    position: relative;

    min-height: 560px;

    overflow: hidden;
}

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

    display: grid;
    place-items: center;

    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 10;

    padding: 0;

    border: 1px solid #e5e5e5;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.96);
    color: var(--color-text);

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    outline: none;

    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.machine-modal-close:hover {
    background: var(--color-primary);
    color: #ffffff;
    transform: scale(1.05);
}

.machine-modal-close:focus-visible {
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.machine-modal-image-wrap {
    min-width: 0;
    min-height: 560px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: var(--color-surface-soft);

    overflow: hidden;
}

.machine-modal-image {
    display: block;

    width: auto;
    height: auto;

    max-width: 96%;
    max-height: 520px;

    object-fit: contain;
    object-position: center;

    border-radius: 12px;
}

.machine-modal-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 56px 48px;

    background: var(--color-surface);
}

.machine-modal-label {
    width: fit-content;

    margin-bottom: 12px;

    color: var(--color-primary);

    font-size: 13px;
    font-weight: 800;
}

.machine-modal-title {
    margin-bottom: 18px;

    color: var(--color-text);

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

.machine-modal-description {
    margin-bottom: 28px;

    color: #5f5f5f;

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

.machine-modal-features-wrap {
    margin-bottom: 30px;

    padding-top: 24px;

    border-top: 1px solid var(--color-border-soft);
}

.machine-modal-features-wrap h4 {
    margin-bottom: 14px;

    color: var(--color-text);

    font-size: 16px;
    font-weight: 800;
}

.machine-modal-features {
    display: grid;
    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.machine-modal-features li {
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.8;
}

.machine-modal-features li::before {
    content: "✓";
    margin-inline-end: 9px;
    color: var(--color-primary);
    font-weight: 900;
}

.machine-modal-contact {
    width: fit-content;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 13px 26px;

    border-radius: var(--radius-sm);

    background: var(--color-primary);
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;
    text-decoration: none;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.machine-modal-contact:hover {
    background: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.14);
}

@keyframes machineModalIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================
   Contact
========================= */

.contact h2 {
    margin-bottom: 20px;
}

.contact-text {
    margin-bottom: 50px;
    color: var(--color-text-muted);
}

.contact-card {
    width: 280px;

    padding: 35px 20px;

    border: 1px solid #dddddd;
    border-radius: var(--radius-md);
}

.contact-card h3 {
    margin: 15px 0;
    font-size: 22px;
}

.contact-card p {
    color: var(--color-text-muted);
}

.contact-link {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-base);
}

.contact-link:hover {
    color: var(--color-primary);
}

/* =========================
   Site Preloader
========================= */

body.preloader-active {
    overflow: hidden;
}

.site-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: grid;
    place-items: center;

    background: var(--color-surface);

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.45s ease,
        visibility 0.45s ease;
}

.site-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-preloader-mark {
    width: clamp(130px, 16vw, 180px);
    aspect-ratio: 1;

    display: grid;
    place-items: center;

    position: relative;
}

.site-preloader-mark::before,
.site-preloader-mark::after {
    content: "";

    position: absolute;
    border-radius: 50%;
}

.site-preloader-mark::before {
    inset: 0;

    border: 2px solid rgba(189, 32, 46, 0.12);
    border-top-color: var(--color-primary);
    border-right-color: var(--color-primary);

    animation: preloaderSpin 1.15s linear infinite;
}

.site-preloader-mark::after {
    inset: 12px;

    border: 1px solid rgba(17, 17, 17, 0.08);
    border-bottom-color: rgba(189, 32, 46, 0.5);

    animation: preloaderSpinReverse 1.7s linear infinite;
}

.site-preloader-logo {
    width: 72%;
    height: auto;

    position: relative;
    z-index: 1;

    animation: preloaderLogoPulse 1.15s ease-in-out infinite alternate;
}

@keyframes preloaderSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes preloaderSpinReverse {
    to {
        transform: rotate(-360deg);
    }
}

@keyframes preloaderLogoPulse {
    from {
        opacity: 0.82;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-preloader-mark::before,
    .site-preloader-mark::after,
    .site-preloader-logo {
        animation: none;
    }

    .site-preloader {
        transition-duration: 0.15s;
    }
}

