/* Shared responsive fixes for page-specific layouts. */
img,
video,
iframe {
    max-width: 100%;
}

.mobile-menu-toggle {
    display: none;
}

@media (max-width: 992px) {

    .footer-grid,
    .footer-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid>*,
    .footer-grid-4>* {
        min-width: 0;
    }
}

@media (max-width: 768px) {

    header,
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav-container {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 0 !important;
        padding: 10px 0 !important;
        min-height: 64px;
    }

    header>.container,
    header.navbar>.container {
        width: 90%;
    }

    .nav-logo-img,
    .site-logo {
        height: 44px !important;
        max-width: min(180px, 52vw);
    }

    .mobile-menu-toggle {
        display: inline-flex;
        position: absolute;
        right: 5%;
        top: 50%;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #d9e0e8;
        border-radius: 6px;
        background: #fff;
        color: #0A2540;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transform: translateY(-50%);
        z-index: 1002;
    }

    .mobile-menu-toggle span,
    .mobile-menu-toggle span::before,
    .mobile-menu-toggle span::after {
        display: block;
        position: absolute;
        width: 20px;
        height: 2px;
        background: currentColor;
        transition: transform 0.2s ease, top 0.2s ease;
        content: "";
    }

    .mobile-menu-toggle span::before {
        top: -6px;
    }

    .mobile-menu-toggle span::after {
        top: 6px;
    }

    .mobile-menu-toggle[aria-expanded="true"] span {
        background: transparent;
    }

    .mobile-menu-toggle[aria-expanded="true"] span::before {
        top: 0;
        transform: rotate(45deg);
    }

    .mobile-menu-toggle[aria-expanded="true"] span::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .nav-links,
    .nav-links.is-open {
        position: absolute !important;
        top: 100%;
        left: 5%;
        right: 5%;
        z-index: 1001;
        display: none !important;
        flex-direction: column;
        align-items: stretch !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        background: #fff;
        border: 1px solid #e4e9ef;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 10px 20px rgba(10, 37, 64, 0.14);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-links.is-open {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
        margin: 0 !important;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 1rem !important;
    }

    .nav-links a:hover,
    .nav-links a:focus-visible {
        background: #f4f7fc;
    }

    .hero {
        background-attachment: scroll !important;
    }

    .hero-buttons {
        flex-wrap: wrap;
        align-items: center;
    }

    .contact-wrapper {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 24px !important;
    }

    .contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .contact-grid>[style*="grid-column"] {
        grid-column: 1 / -1 !important;
    }

    .footer-grid,
    .footer-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid>*,
    .footer-grid-4>* {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .security-card {
        min-width: 0;
        padding: 28px 24px;
    }

    .hero-content,
    .container,
    .nav-container {
        min-width: 0;
    }

    h1,
    h2,
    h3,
    h4,
    p,
    a {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 600px) {

    .footer-grid,
    .footer-grid-4 {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .contact-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .contact-grid>[style*="grid-column"] {
        grid-column: auto !important;
    }

    .section-title,
    .section-title h2 {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hero-buttons>a,
    .hero-buttons>button {
        max-width: 100%;
        min-height: 44px;
    }

    .form-control {
        min-width: 0;
        max-width: 100%;
    }

    .footer-bottom-content,
    .footer-bottom-bar {
        align-items: center;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 390px) {
    .container {
        width: calc(100% - 32px);
    }

    .hero h1,
    .page-hero h1,
    .hero-content h1 {
        font-size: clamp(1.35rem, 7vw, 1.8rem) !important;
        line-height: 1.2;
    }

    .hero-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .contact-form-card {
        padding: 28px 20px !important;
    }
}