/* Shared responsive safeguards. Loaded last by the common navbar so these
   rules consistently win over the legacy, page-specific stylesheets. */
html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

iframe,
embed,
object {
    max-width: 100%;
}

table {
    max-width: 100%;
}

p,
li,
h1,
h2,
h3,
h4,
a,
span {
    overflow-wrap: break-word;
}

@media (max-width: 991px) {
    /* Keep the expanded menu usable on short phones and landscape screens. */
    .site-navbar-page #header .header_menu .navbar-collapse.collapse.in {
        max-height: calc(100vh - 72px);
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .site-navbar-page #header .header_menu .dropdown-menu > li > a {
        padding: 11px 10px;
        white-space: normal;
    }

    /* Bootstrap rows used as flex/grid wrappers must not retain desktop widths. */
    .site-navbar-page main,
    .site-navbar-page main section,
    .site-navbar-page main [class*="-panel"],
    .site-navbar-page main [class*="-card"] {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .container {
        width: 100%;
        padding-right: 20px;
        padding-left: 20px;
    }

    .row {
        margin-right: -10px;
        margin-left: -10px;
    }

    .row > [class*="col-"] {
        padding-right: 10px;
        padding-left: 10px;
    }

    /* Long document/service labels and contact values should wrap, not widen the page. */
    .document-card,
    .documents-modern-card,
    .modern-home-footer,
    .modern-home-footer a,
    .footer-contact-item,
    .footer-contact-item p {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .modern-home-footer .footer-logo {
        width: 100%;
        max-width: 225px;
    }

    /* Service pages contain wide desktop CTA/flex layouts. */
    .cta-panel,
    .hygiene-cta-panel,
    .accreditation-cta-box,
    .accreditation-standard-card,
    .periodic-modern-hero,
    .equipment-modern-hero,
    .ndt-detail-banner,
    .liquid-modern-hero {
        width: 100%;
        min-width: 0;
    }

    .trafo-btn,
    .hygiene-btn,
    .accreditation-primary-btn,
    .accreditation-secondary-btn {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .trafo-visual {
        height: min(340px, 92vw);
    }

    .trafo-voltage.second {
        right: 20px;
        left: auto;
    }

    .hygiene-hero h1,
    .trafo-hero h1 {
        overflow-wrap: normal;
        word-break: normal;
    }

    .table-responsive {
        width: 100%;
        margin-bottom: 15px;
        overflow-x: auto;
        border: 0;
        -webkit-overflow-scrolling: touch;
    }

    /* Homepage carousels use direct finger swiping on touch screens. */
    .home-page #slider .carousel {
        touch-action: pan-y;
    }

    /* The source images reserve their right side for desktop copy. On a
       portrait crop, centering that wide canvas hides the inspectors. Keep a
       per-slide focal point so people and equipment remain in frame. */
    .home-page #slider #time-slider .slider_overlay > img {
        object-position: 16% center;
    }

    .home-page #slider #industry-slider .slider_overlay > img {
        object-position: 15% center;
    }

    .home-page #slider #slider3 .slider_overlay > img {
        object-position: 30% center;
    }

    .home-page #slider .carousel-control {
        display: none;
    }

    .home-page #slider .carousel-indicators {
        display: none;
    }

    /* Give the mobile carousel copy one predictable reading zone. Keeping it
       at the bottom leaves faces visible and avoids text floating over the
       focal point at different phone aspect ratios. */
    .home-page #slider .carousel-caption,
    .home-page #slider #time-slider .carousel-caption,
    .home-page #slider #industry-slider .carousel-caption,
    .home-page #slider #slider3 .carousel-caption {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: flex-end;
        justify-content: flex-start;
        padding: 0 24px 34px;
        text-align: left;
    }

    .home-page #slider .slider_text,
    .home-page #slider #time-slider .slider_text,
    .home-page #slider #industry-slider .slider_text,
    .home-page #slider #slider3 .slider_text {
        width: 100%;
        max-width: 560px;
        margin: 0;
        padding: 13px 0 0 16px;
        text-align: left;
    }

    .home-page #slider .slider_text:before {
        top: 13px;
        bottom: 0;
        width: 3px;
    }

    .home-page #slider .slider-kicker {
        margin-bottom: 8px;
        font-size: 10px;
        line-height: 1.35;
        letter-spacing: 1.25px;
    }

    .home-page #slider .slider_text h2 {
        max-width: 520px;
        margin: 0 0 14px;
        font-size: clamp(25px, 5.5vw, 31px);
        line-height: 1.16;
        text-wrap: balance;
    }

    .home-page #slider .slider_text p {
        display: none;
    }

    .home-page #slider .slider_text a.custom_btn {
        min-height: 40px;
        padding: 0 17px;
        font-size: 12px;
    }

    .home-page #slider #time-slider .slider_overlay:after,
    .home-page #slider #industry-slider .slider_overlay:after,
    .home-page #slider #slider3 .slider_overlay:after {
        background:
            linear-gradient(180deg, rgba(4, 22, 34, .04) 20%, rgba(5, 29, 45, .28) 56%, rgba(5, 25, 39, .92) 100%),
            linear-gradient(90deg, rgba(5, 29, 45, .12), rgba(5, 29, 45, .04));
    }

    #referance.references-home-modern .owl-dots {
        display: none !important;
    }

    #referance.references-home-modern .owl-stage-outer {
        touch-action: pan-y;
    }

    /* About/contact calls-to-action on periodic control pages. The original
       layout stays horizontal until 600px, which makes the fixed-size button
       collide with longer Turkish copy on common 601-767px phone widths. */
    .periodic-modern-about-cta,
    .service-modern-about-cta {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
        height: auto;
    }

    .periodic-modern-about-cta > div,
    .service-modern-about-cta > div {
        width: 100%;
        min-width: 0;
    }

    .periodic-modern-about-cta p,
    .service-modern-about-cta p {
        margin-bottom: 0;
    }

    .periodic-modern-about-cta > a,
    .service-modern-about-cta > a {
        position: static;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        max-width: 100%;
        margin: 0;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .container {
        padding-right: 15px;
        padding-left: 15px;
    }

    .site-navbar-page #header .header_menu .custom_navbar-brand {
        max-width: calc(100% - 58px);
    }

    .site-navbar-page #header .header_menu .custom_navbar-brand img {
        width: 100%;
        max-width: 180px;
        object-fit: contain;
    }

    .site-navbar-page #header .header_menu .navbar-toggle {
        margin-right: 0;
    }

    .home-page #slider #time-slider .slider_overlay > img {
        object-position: 13% center;
    }

    .home-page #slider #industry-slider .slider_overlay > img {
        object-position: 12% center;
    }

    .home-page #slider #slider3 .slider_overlay > img {
        object-position: 29% center;
    }

    .home-page #slider .carousel-caption,
    .home-page #slider #time-slider .carousel-caption,
    .home-page #slider #industry-slider .carousel-caption,
    .home-page #slider #slider3 .carousel-caption {
        padding: 0 18px 26px;
    }

    .home-page #slider .slider_text,
    .home-page #slider #time-slider .slider_text,
    .home-page #slider #industry-slider .slider_text,
    .home-page #slider #slider3 .slider_text {
        padding-left: 13px;
    }

    .home-page #slider .slider_text h2 {
        margin-bottom: 12px;
        font-size: clamp(23px, 7.4vw, 28px);
    }

    .home-page #slider .slider-kicker {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .home-page #slider .slider_text a.custom_btn {
        min-height: 38px;
        padding: 0 14px;
        font-size: 11px;
    }

    .hygiene-hero h1,
    .trafo-hero h1 {
        font-size: clamp(31px, 10vw, 38px);
        letter-spacing: -1px;
    }

    .hygiene-cta-panel,
    .cta-panel,
    .accreditation-standard-card,
    .accreditation-cta-box {
        padding-right: 22px;
        padding-left: 22px;
    }

    .trafo-service,
    .trafo-service.wide {
        min-height: 0;
        padding-bottom: 82px;
    }

    .trafo-service .service-title {
        padding-right: 20px;
    }

    .modern-home-footer .footer-contact-item > i {
        flex-basis: 30px;
        margin-right: 9px;
    }

    .periodic-modern-about-cta,
    .service-modern-about-cta {
        padding: 24px 22px;
    }

    .periodic-modern-about-cta > a,
    .service-modern-about-cta > a {
        width: 100%;
    }
}

@media (max-width: 340px) {
    .site-navbar-page #header .header_menu .custom_navbar-brand img {
        max-width: 155px;
    }

    .trafo-voltage {
        left: 18px;
    }

    .trafo-voltage.second {
        right: 18px;
    }
}
