/* ========================================
   VISTWIN — Site-wide responsive layer
   Loads after mobile CSS; before page-specific extraCss
   ======================================== */

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    max-width: 100%;
}

#main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.container {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ========== Forms (site-wide) ========== */
.form-control,
select.form-control,
.custom-select,
.auth-card input.form-control,
.contact-form input.form-control,
.contact-form textarea.form-control,
.contact-form select.form-control {
    height: auto !important;
    min-height: 48px;
    font-size: 16px !important;
    line-height: 1.5 !important;
    box-sizing: border-box;
    max-width: 100%;
}

textarea.form-control {
    min-height: 120px !important;
    resize: vertical;
}

select.form-control,
.custom-select {
    padding-right: 2.25rem !important;
}

label,
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.btn,
.btn-primary,
.btn-outline-primary {
    min-height: 44px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ========== Page headers (all marketing pages) ========== */
.page-header {
    padding: clamp(40px, 8vw, 64px) 0 clamp(32px, 6vw, 48px) !important;
    overflow: visible !important;
}

.page-header h1,
.page-header h3 {
    font-size: clamp(1.65rem, 5vw, 2.4rem) !important;
    line-height: 1.2 !important;
    word-wrap: break-word;
}

.page-header .breadcrumb {
    flex-wrap: wrap;
    justify-content: center;
}

.page-header .section-badge {
    font-size: clamp(11px, 2.5vw, 13px);
}

/* ========== Hero (fluid — overrides fixed vh rules) ========== */
@media (max-width: 991px) {
    .hero-slide {
        height: auto !important;
        min-height: min(75vh, 620px) !important;
        padding: clamp(72px, 14vw, 100px) 0 clamp(48px, 10vw, 70px) !important;
    }

    .hero-content {
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .topbar {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .hero-slide {
        min-height: min(68vh, 520px) !important;
        padding: 64px 0 40px !important;
    }

    .hero-title {
        font-size: clamp(1.65rem, 7vw, 2rem) !important;
    }

    .hero-description {
        font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
    }
}

@media (max-width: 896px) and (orientation: landscape) {
    .hero-slide {
        min-height: auto !important;
        padding: 56px 0 32px !important;
    }
}

/* ========== Section spacing ========== */
@media (max-width: 991px) {
    .features-section-ultra,
    .about-section-ultra-v2,
    .services-section,
    .gallery-section,
    .clients-section-ultra,
    .career-section {
        padding-top: clamp(44px, 8vw, 56px) !important;
        padding-bottom: clamp(44px, 8vw, 56px) !important;
    }

    .container-fluid.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .container.py-5 {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }
}

/* ========== Contact page ========== */
@media (max-width: 991px) {
    .contact-info-wrapper,
    .contact-form-wrapper,
    .contact-form {
        padding: clamp(20px, 4vw, 28px) !important;
        margin-bottom: 20px;
    }

    .contact-info-item {
        margin-bottom: 16px;
    }
}

@media (max-width: 767px) {
    .contact-form .row > [class*="col-"],
    .contact-page .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========== Gallery & grids ========== */
@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .gallery-item img {
        height: auto !important;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========== Services jump nav ========== */
@media (max-width: 767px) {
    .service-jump-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .service-jump-nav > .col-auto {
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
        padding: 0 !important;
        margin-bottom: 0 !important;
    }

    .service-jump-nav .btn {
        white-space: normal;
        text-align: center;
        line-height: 1.35;
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ========== Service blocks ========== */
@media (max-width: 991px) {
    .service-block-media img {
        height: auto !important;
        min-height: 180px;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }

    .service-block {
        scroll-margin-top: 100px;
    }
}

/* ========== Footer ========== */
@media (max-width: 991px) {
    footer .row > [class*="col-"] {
        margin-bottom: 28px;
    }

    footer .footer-quick-links ul {
        margin-bottom: 0;
    }
}

@media (max-width: 575px) {
    footer {
        text-align: center;
    }

    footer .footer-quick-links .row {
        justify-content: center;
    }
}

/* ========== Auth (login / signup) ========== */
@media (max-width: 767px) {
    .auth-page {
        min-height: auto !important;
        padding: clamp(32px, 8vw, 64px) 0 !important;
    }

    .auth-card .card-body {
        padding: clamp(24px, 5vw, 40px) !important;
    }

    .auth-card {
        margin: 0 4px;
    }
}

/* ========== Back to top ========== */
@media (max-width: 767px) {
    .back-to-top {
        right: max(16px, env(safe-area-inset-right, 0px));
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        width: 44px;
        height: 44px;
    }
}

/* ========== Modals & tables ========== */
.modal-dialog {
    margin: 1rem auto;
    max-width: calc(100% - 2rem);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== Software download ========== */
@media (max-width: 767px) {
    .download-card,
    .software-card {
        margin-bottom: 16px;
    }
}

/* ========== Utility: prevent overflow ========== */
.row {
    max-width: 100%;
}

[class*="col-"] {
    min-width: 0;
}

.w-100-mobile {
    width: 100% !important;
}

@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide,
    .carousel-item {
        transition: none !important;
    }
}

/* Landline desk-phone icon (4633299714) */
.vw-landline-icon {
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

.topbar-item .vw-landline-icon,
footer .vw-landline-icon {
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.contact-info-icon .vw-landline-icon {
    filter: brightness(0) invert(1);
}
