/* ==================================================
   GLOBAL RESPONSIVE PROTECTION
   Loaded after all component styles
================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    overflow-x: clip;
}

main,
section,
header,
footer,
nav {
    min-width: 0;
}

.container,
.container-fluid,
.row,
.row > * {
    min-width: 0;
}

/* Responsive media */

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

iframe {
    display: block;
    max-width: 100%;
}

/* Prevent long content from breaking layouts */

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

.footer-info a,
.contact-item a,
.footer-bottom {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Forms */

input,
select,
textarea,
button {
    max-width: 100%;
    font-family: inherit;
}

input,
select,
textarea {
    min-width: 0;
}

textarea {
    resize: vertical;
}

/* Buttons and links */

.btn {
    max-width: 100%;
    white-space: normal;
    touch-action: manipulation;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(249, 115, 22, 0.16);
}

/* Cards and boxes */

.service-card,
.feature-card,
.why-card,
.about-info-card,
.contact-card,
.contact-preview-box,
.contact-form-wrapper,
.booking-form-wrapper,
.cta-box {
    min-width: 0;
    max-width: 100%;
}

/* Tables, if added to a public page */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

/* Flash messages */

.alert {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* ==================================================
   TABLETS AND COLLAPSED NAVIGATION
================================================== */

@media (max-width: 991.98px) {
    html {
        scroll-padding-top: 82px;
    }

    .container,
    .container-md,
    .container-sm {
        max-width: 100%;
    }

    /* Ensure stacked Bootstrap columns stay inside viewport */

    [class*="col-"] {
        min-width: 0;
    }

    /* Disable desktop-style hover movement on touch layouts */

    .service-card,
    .feature-card,
    .why-card,
    .about-info-card {
        transform: none;
    }
}

/* ==================================================
   PHONES
================================================== */

@media (max-width: 767.98px) {
    html {
        scroll-padding-top: 76px;
    }

    body {
        font-size: 16px;
    }

    .container,
    .container-sm {
        width: 100%;
        padding-right: 16px;
        padding-left: 16px;
    }

    /* Consistent responsive headings */

    h1 {
        line-height: 1.15;
    }

    h2 {
        line-height: 1.2;
    }

    h3,
    h4,
    h5 {
        line-height: 1.3;
    }

    .section-badge,
    .section-tag {
        max-width: 100%;
        line-height: 1.5;
        white-space: normal;
    }

    /*
     * Prevent Safari on iPhone from automatically zooming
     * when the user focuses on a form field.
     */

    input,
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    input,
    select,
    .form-control,
    .form-select {
        min-height: 48px;
    }

    /* Mobile touch targets */

    button,
    .btn,
    .nav-link,
    .footer-social a {
        touch-action: manipulation;
    }

    .btn {
        min-height: 46px;
    }

    /* Keep notification close button accessible */

    .alert {
        padding-right: 3rem;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .alert .btn-close {
        min-height: auto;
    }

    /* Maps */

    iframe {
        width: 100%;
    }
}

/* ==================================================
   COMMON PHONE WIDTHS: 320–575px
================================================== */

@media (max-width: 575.98px) {
    html {
        scroll-padding-top: 72px;
    }

    .container,
    .container-sm {
        padding-right: 14px;
        padding-left: 14px;
    }

    .row {
        --bs-gutter-x: 1.25rem;
    }

    .section-badge,
    .section-tag {
        font-size: 0.78rem;
        letter-spacing: 0.08em;
    }

    .section-title {
        overflow-wrap: anywhere;
    }

    /* Full-width action buttons inside forms and CTA sections */

    .booking-form-wrapper button[type="submit"],
    .contact-form-wrapper button[type="submit"],
    .cta-section .col-lg-4 .btn,
    .cta-buttons .btn {
        width: 100%;
    }

    /* Avoid mobile overflow from Bootstrap margins */

    .cta-section .me-2,
    .service-cta .me-2 {
        margin-right: 0 !important;
    }

    /* Allow long footer information to wrap */

    .footer-info li,
    .footer-info a {
        max-width: 100%;
    }
}

/* ==================================================
   VERY SMALL PHONES: 320–374px
================================================== */

@media (max-width: 374.98px) {
    .container,
    .container-sm {
        padding-right: 12px;
        padding-left: 12px;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    body {
        font-size: 15px;
    }

    /*
     * Form inputs must remain 16px on iPhone,
     * even when general body text becomes smaller.
     */

    input,
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    .btn {
        width: auto;
        min-height: 46px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .hero-buttons .btn,
    .booking-form-wrapper .btn,
    .contact-form-wrapper .btn,
    .cta-section .btn,
    .cta-buttons .btn {
        width: 100%;
    }
}

/* ==================================================
   SHORT LANDSCAPE PHONE SCREENS
================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .navbar-collapse {
        max-height: calc(100dvh - 68px);
        overflow-y: auto;
    }
}

/* ==================================================
   TOUCH DEVICES
================================================== */

@media (hover: none) and (pointer: coarse) {
    .service-card:hover,
    .feature-card:hover,
    .why-card:hover,
    .about-info-card:hover,
    .hero-image:hover,
    .footer-social a:hover,
    .footer-map-link:hover,
    .btn:hover {
        transform: none;
    }
}

/* ==================================================
   ACCESSIBILITY
================================================== */

:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.45);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (prefers-contrast: more) {
    .service-card,
    .feature-card,
    .why-card,
    .about-info-card,
    .contact-card,
    .booking-form-wrapper {
        border-color: #667085;
    }
}