/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* Logo-aligned palette: blue, orange-red, accent bars */
    --primary: #0066cc;
    --primary-dark: #004c99;
    --secondary: #e85d04;
    --accent-orange: #ff7f00;
    --accent-red: #cc3300;
    --accent-green: #009933;
    --accent-yellow: #ffcc00;
    --light: #f5f9ff;
    --dark: #212529;
    --gray: #666666;
    --success: #009933;
    --danger: #cc0000;
    --warning: #ffcc00;
    --info: #0066cc;
    --white: #ffffff;
    --black: #000000;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0, 102, 204, 0.12);
    --shadow-hover: 0 10px 30px rgba(0, 102, 204, 0.18);
    /* Orange accent under headings (section titles, footer, sidebar) — one size everywhere */
    --heading-accent-bar-height: 2px;
    --heading-accent-bar-color: var(--secondary);
    /* Scroll-reveal timing for orange underlines (::after on h2/h3) */
    --heading-accent-reveal-duration: 1.35s;
    --heading-accent-reveal-duration-long: 3.75s;
    /* Navbar link underline (hover/active) — keep separate from heading accents */
    --nav-underline-height: 2px;
    /* Navbar + announcement bar heights */
    --navbar-main-height: 80px;
    --announcement-bar-height: 34px;
    --navbar-total-height: calc(var(--navbar-main-height) + (var(--announcement-bar-height) * 2));
}

/*
 * Responsive layout (why things change across widths):
 * - Viewport: every page uses <meta name="viewport" content="width=device-width, initial-scale=1">.
 * - Breakpoints: rules are split at 1200 / 1024 / 900 / 768 / 600 / 480px — different sections
 *   reflow (nav, partners grid, home intro inline CSS) at different thresholds, so the layout
 *   “shifts” when crossing those widths.
 * - Home page: index.html loads css/style.css first, then a large inline <style> block that
 *   overrides or adds page-only rules; other pages mostly use style.css only.
 * - Widths: many sections share max-width: 1400px + horizontal padding 5% — content aligns until
 *   the viewport is narrower than that padding + content.
 * - Flex/grid: children default to min-width: auto; wide content can overflow unless min-width: 0
 *   is set on the grid/flex item that should shrink.
 * - Shared flex patterns: .page-header .breadcrumb, .contact-info li, .social-links, newsletter row,
 *   and optional .flex-* helpers below for custom sections.
 */

/* ===== GLOBAL STYLES ===== */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--light);
}

body {
    overflow-x: hidden;
    color: var(--dark);
    line-height: 1.6;
}

/* ----- Responsive images & media (site-wide) ----- */
picture {
    display: block;
    max-width: 100%;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Inline SVGs scale down with layout; fixed-size icons use more specific rules elsewhere */
svg {
    max-width: 100%;
    height: auto;
}

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

audio {
    max-width: 100%;
}

/* Embedded players / maps / documents: never wider than the viewport */
iframe,
embed,
object {
    max-width: 100%;
    display: block;
}

figure {
    margin: 0;
    max-width: 100%;
}

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

/* Optional wrappers: add class on a div around YouTube / Google Maps / etc. */
.media-fluid {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.media-fluid iframe,
.media-fluid embed,
.media-fluid object,
.media-fluid video {
    width: 100%;
    max-width: 100%;
    border: 0;
}

/* 16:9 embeds — keeps height proportional on all screen widths */
.media-fluid--video {
    aspect-ratio: 16 / 9;
    max-height: none;
}

.media-fluid--video iframe,
.media-fluid--video embed,
.media-fluid--video object {
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    color: var(--primary);
    position: relative;
    padding-bottom: 1rem;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--heading-accent-bar-height);
    background: var(--heading-accent-bar-color);
    /* Fallback (no clip-path support) */
    transform: scaleX(1);
    transform-origin: center;
    transition: transform var(--heading-accent-reveal-duration-long) cubic-bezier(0.22, 1, 0.36, 1);
}

/* Scroll-in: bar grows from center when .reveal enters view (see main.js) */
.section-title.reveal h2::after {
    transform: scaleX(0);
}

.section-title.reveal.active h2::after {
    transform: scaleX(1);
}

@supports (clip-path: inset(0 0 0 0)) {

    .section-title h2::after {
        transform: none;
        transition: clip-path var(--heading-accent-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
        clip-path: inset(0 0 0 0);
        will-change: clip-path;
    }

    .section-title.reveal h2::after {
        transform: none;
        clip-path: inset(0 50% 0 50%);
    }

    .section-title.reveal.active h2::after {
        transform: none;
        clip-path: inset(0 0 0 0);
    }
}

@media (max-width: 768px) {
    .why-choose .section-title h2::after {
        width: 58%;
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .why-choose .section-title h2::after {
        width: 62%;
    }
}

.section-title p {
    color: var(--gray);
    max-width: 600px;
    margin: 1rem auto 0;
}

/* Sidebar widgets (e.g. blog) — same accent bar as .section-title */
.sidebar-widget h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--heading-accent-bar-height);
    background: var(--heading-accent-bar-color);
    /* Fallback (no clip-path support) */
    transform: scaleX(1);
    transform-origin: center;
    transition: transform var(--heading-accent-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-widget.reveal h3::after {
    transform: scaleX(0);
}

.sidebar-widget.reveal.active h3::after {
    transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {

    .section-title.reveal h2::after,
    .sidebar-widget.reveal h3::after {
        transform: scaleX(1);
        transition: none;
    }
}

@supports (clip-path: inset(0 0 0 0)) {
    @media (prefers-reduced-motion: reduce) {

        .section-title h2::after,
        .sidebar-widget h3::after {
            clip-path: inset(0 0 0 0) !important;
            transition: none !important;
        }
    }

    .sidebar-widget h3::after {
        transform: none;
        transition: clip-path var(--heading-accent-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
        clip-path: inset(0 0 0 0);
        will-change: clip-path;
    }

    .sidebar-widget.reveal h3::after {
        transform: none;
        clip-path: inset(0 50% 0 50%);
    }

    .sidebar-widget.reveal.active h3::after {
        transform: none;
        clip-path: inset(0 0 0 0);
    }
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 102, 204, 0.96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: none;
    z-index: 1000;
    transition: var(--transition);
    padding: 0;
    min-height: var(--navbar-total-height);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-bottom: none;
    overflow: visible;
}

.navbar.scrolled {
    min-height: var(--navbar-total-height);
    background: rgba(0, 102, 204, 0.98);
    box-shadow: none;
}

/* Keep navbar links readable on blue background. Logo image stays unchanged. */
.navbar .nav-menu a {
    color: var(--white);
}

.navbar .nav-menu a:hover,
.navbar .nav-menu a.active {
    color: var(--white);
}

/* Room for ::after underline so it is not clipped; keeps active bar visually constant */
.navbar .nav-menu a:not(.quote-btn) {
    padding-bottom: 0.35rem;
}

/* Persist orange underline on current page (same as Home on index) */
.navbar .nav-menu a:not(.quote-btn).active::after {
    transform: translateX(-50%) scaleX(1);
    z-index: 1;
}

.navbar .hamburger {
    color: var(--white);
}

.nav-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--navbar-main-height);
    padding: 0.45rem 5%;
    box-sizing: border-box;
    min-width: 0;
}

.navbar.scrolled .nav-container {
    padding: 0.35rem 5%;
}

/* Announcement marquee bar under navbar */
.announcement-bar {
    height: var(--announcement-bar-height);
    width: 100%;
    background: var(--white);
    border-top: none;
    border-bottom: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.announcement-bar-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop: keep announcement text aligned with the same side margins as navbar content */
@media (min-width: 769px) {
    .announcement-bar-inner {
        justify-content: flex-start !important;
    }

    .announcement-track {
        justify-content: flex-start !important;
    }
}

@media (max-width: 768px) {
    /* Full-width bars (no side inset); inner padding keeps text off screen edges */
    .announcement-bar {
        background: var(--white);
    }

    .announcement-bar-inner {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0 clamp(0.65rem, 3.5%, 0.85rem);
        background: transparent;
    }
}

.announcement-track {
    display: inline-flex;
    align-items: center;
    gap: 3rem;
    white-space: nowrap;
    will-change: transform;
    animation: announcementMarquee 30s linear infinite;
    color: var(--dark);
    font-weight: 600;
    letter-spacing: 0.01em;
    font-size: 0.95rem;
    justify-content: center;
}

/* Desktop: align marquee content to the same left padding as the bar */
@media (min-width: 769px) {
    .announcement-track {
        justify-content: flex-start;
        width: 100%;
    }
}

/* JS-controlled pause on mousedown/touch – see navbar.js */

.announcement-track span {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

/* Top bar: static (no marquee) with call us text */
.announcement-bar--top .announcement-track {
    animation: none;
    justify-content: flex-start;
}

/* Ensure "Call us" sticks to left padding (not centered by inner container) */
.announcement-bar--top .announcement-bar-inner {
    justify-content: flex-start;
}

.announcement-bar--top .announcement-track {
    width: 100%;
}

.announcement-bar--top .announcement-track a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.announcement-bar--top .announcement-track a:hover {
    text-decoration: underline;
}

.announcement-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--secondary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18);
    flex-shrink: 0;
}

@keyframes announcementMarquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Dedicated logo area wrapper in navbar */
.navbar-logo-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 0.15rem 0.35rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 65px;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo:hover {
    transform: scale(1.05);
}

.logo:hover .logo-img {
    filter: brightness(1.05);
}

.logo span {
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu > li {
    position: relative;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100%;
    height: var(--nav-underline-height);
    background: var(--secondary);
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    transform: translateX(-50%) scaleX(1);
}

.dropdown-toggle i {
    font-size: 0.75rem;
    margin-left: 0.35rem;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: min(1020px, 94vw);
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0, 102, 204, 0.12);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
    padding: 1rem 1.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
    max-height: 72vh;
    overflow-y: auto;
}

.nav-dropdown[aria-label="Personal insurance menu"] {
    width: min(760px, 92vw);
}

.has-dropdown.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.dropdown-grid.business-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dropdown-col h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 0.55rem;
}

.dropdown-col a {
    display: block;
    font-size: 0.92rem;
    color: var(--dark);
    text-decoration: none;
    padding: 0.4rem 0;
}

.dropdown-col a::after {
    display: none;
}

.dropdown-col a:hover {
    color: var(--secondary);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
}

.hamburger i {
    display: block;
    transition: transform 0.22s ease, opacity 0.22s ease;
    transform-origin: 50% 50%;
}

.hamburger.is-open i {
    transform: rotate(90deg) scale(1.02);
}

.quote-btn {
    background: var(--secondary);
    color: var(--white) !important;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    animation: pulse 2s infinite;
}

.quote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(232, 93, 4, 0.4);
}

.quote-btn::after {
    display: none;
}

/* Get Quote on its page: no underline (button shape); show clear active state */
.navbar .nav-menu a.quote-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(232, 93, 4, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(232, 93, 4, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(232, 93, 4, 0);
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: var(--secondary);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(232, 93, 4, 0.4);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

.btn-light {
    background: var(--white);
    color: var(--primary);
}

.btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Homepage intro + stat cards (mobile): show immediately — global .reveal stays hidden until scroll */
@media (max-width: 768px) {
    .home-intro-inner.reveal,
    .home-intro-inner.reveal.active {
        opacity: 1;
        transform: translateY(0);
    }

    .home-intro-stats .stat-item.reveal,
    .home-intro-stats .stat-item.reveal.active {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-top: var(--navbar-total-height);
    padding: clamp(1.65rem, 3.2vw, 2.25rem) 5%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Most pages use a top hero section with a custom *-hero class and hardcoded 80px offset.
   Override them globally so the new announcement bar never overlaps content. */
body > section[class$="-hero"] {
    margin-top: var(--navbar-total-height) !important;
}

/* Product/detail pages use .detail-content (not *-hero); same fixed navbar stack offset */
body > section.detail-content {
    margin-top: var(--navbar-total-height) !important;
}

/* Homepage uses a wrapper with padding-top. Keep it in sync globally. */
body > .home-intro-screen {
    padding-top: var(--navbar-total-height) !important;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: cover;
    opacity: 0.3;
}

.page-header h1 {
    font-size: clamp(1.85rem, 3.6vw, 2.65rem);
    margin-bottom: 0.4rem;
    position: relative;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Flex + wrap: breadcrumbs stay centered and reflow on narrow screens (all pages with .page-header) */
.page-header .breadcrumb {
    position: relative;
    font-size: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.5rem;
    max-width: 100%;
}

.page-header .breadcrumb a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.page-header .breadcrumb a:hover {
    opacity: 1;
}

.page-header .breadcrumb span {
    color: var(--secondary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 4rem 5% 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
    color: var(--white);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--heading-accent-bar-height);
    background: var(--heading-accent-bar-color);
}

.footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 62px;
    width: auto;
    display: block;
    object-fit: contain;
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.8;
    margin-bottom: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-3px) scale(1.1);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    display: inline-block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footer-links a:hover {
    opacity: 1;
    transform: translateX(5px);
    color: var(--secondary);
}

.contact-info {
    list-style: none;
}

.footer-address-block {
    margin-bottom: 1.25rem;
}

.footer-address-block strong {
    display: block;
    color: var(--white);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
}

.footer-address-block p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.contact-info li {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    opacity: 0.9;
    min-width: 0;
}

.contact-info a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.2s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.contact-info a:hover {
    opacity: 1;
    color: var(--secondary);
}

.contact-info i {
    color: var(--secondary);
    width: 20px;
    flex-shrink: 0;
    transform: translateY(2px);
}

.footer-bottom {
    background: #212529;
    color: var(--dark);
    margin-top: 2rem;
    padding: 1.25rem 5% 1.75rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-top: 1px solid rgba(255, 255, 255, 0.96);
}

.footer-legal {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-legal p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--white);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    opacity: 1;
}

/* =================================================================
   SITE-WIDE FLEX HELPERS (any page — add class where you need a row
   that stacks cleanly on phones; uses flexbox + wrap, not device names)
   ================================================================= */
.flex-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.flex-responsive--start {
    justify-content: flex-start;
}

.flex-responsive--stretch {
    align-items: stretch;
}

@media (max-width: 768px) {
    .flex-responsive {
        flex-direction: column;
        align-items: stretch;
    }

    .flex-responsive--row-mobile {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar,
    .navbar.scrolled {
        padding: 0;
        min-height: var(--navbar-total-height);
    }

    /* Middle row + slide-out menu must stack above announcement bars (siblings below in DOM) */
    .navbar .nav-container {
        position: relative;
        z-index: 2;
    }

    .navbar .announcement-bar {
        position: relative;
        z-index: 1;
    }

    .navbar-logo-container {
        padding: 0.12rem 0.3rem;
    }

    .logo-img {
        height: 66px;
    }

    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--navbar-total-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--navbar-total-height));
        z-index: 3;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        overflow-y: auto;
        overflow-x: hidden;
        transition: left 0.3s ease;
        padding: 1rem 0.5rem 1.25rem;
        gap: 0;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
    }

    /* Mobile menu panel is white: revert link color for readability */
    .navbar .nav-menu a {
        color: var(--dark);
    }

    .navbar .nav-menu a:hover,
    .navbar .nav-menu a.active {
        color: var(--primary);
    }

    .navbar .nav-menu a:not(.quote-btn).active::after {
        transform: translateX(-50%) scaleX(1);
    }

    .navbar .nav-menu a.quote-btn.active {
        box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.35);
    }

    .nav-menu > li {
        width: 100%;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        font-size: 1.1rem;
        display: block;
        width: 100%;
        padding: 0.9rem 0.5rem;
    }

    .nav-dropdown {
        position: static;
        transform: none;
        width: calc(100% - 1.6rem);
        margin-top: 0;
        padding: 0.75rem 0.75rem;
        border-radius: 0;
        box-shadow: none;
        border: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: none;
        max-width: none;
        margin-left: auto;
        margin-right: 0;
        align-self: flex-end;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .has-dropdown.open .nav-dropdown {
        display: block;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    /* Force Personal/Business mega-menu to become single column on mobile */
    .dropdown-grid.personal-grid,
    .dropdown-grid.business-grid {
        grid-template-columns: 1fr !important;
        gap: 0.15rem;
    }

    .nav-dropdown .dropdown-col,
    .nav-dropdown .dropdown-col h4,
    .nav-dropdown .dropdown-col a {
        text-align: left;
    }

    .nav-dropdown[aria-label="Personal insurance menu"] {
        width: 100% !important;
        max-width: none;
        margin-left: auto;
        margin-right: 0;
        /* Shift dropdown to the right only on mobile */
        transform: translateX(12px) !important;
    }

    .nav-dropdown[aria-label="Business insurance menu"] {
        width: 100% !important;
        max-width: none;
        margin-left: auto;
        margin-right: 0;
        /* Shift dropdown to the right only on mobile */
        transform: translateX(12px) !important;
    }

    /* Mobile dropdown stays inside menu padding */

    .dropdown-toggle i {
        transition: transform 0.2s ease;
    }

    .has-dropdown.open .dropdown-toggle i {
        transform: rotate(180deg);
    }

    .page-header h1 {
        font-size: clamp(1.75rem, 5vw, 2.2rem);
    }
}

@media (max-width: 480px) {
    .navbar,
    .navbar.scrolled {
        padding: 0;
        min-height: var(--navbar-total-height);
    }

    .navbar-logo-container {
        padding: 0.1rem 0.24rem;
    }

    .logo-img {
        height: 56px;
    }

    .page-header h1 {
        font-size: clamp(1.6rem, 6vw, 1.95rem);
    }

    .btn {
        padding: 0.6rem 1.5rem;
    }
}


/* ===== SIMPLE CUSTOM CURSOR ===== */
.custom-cursor {
    width: 30px;
    height: 30px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    /* No transition on transform – cursor position stays instant like normal cursor */
    transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    will-change: transform;
}

.custom-cursor.active {
    width: 50px;
    height: 50px;
    border-color: var(--primary);
    background: rgba(232, 93, 4, 0.1);
}

/* Hide default cursor on desktop */
@media (min-width: 769px) {
    body {
        cursor: none;
    }

    a,
    button,
    .btn,
    .service-card,
    .blog-card {
        cursor: none;
    }
}

/* Show default cursor on mobile */
@media (max-width: 768px) {
    .custom-cursor {
        display: none;
    }

    body {
        cursor: auto;
    }
}

.custom-cursor {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.custom-cursor::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 1px solid var(--secondary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease;
}

.custom-cursor.active::after {
    width: 40px;
    height: 40px;
    border-color: var(--primary);
}

/* Hero Badges */
.hero-badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.3);
    z-index: 100;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.05);
    color: white;
}

/* Calculator Section */
.calculator-section {
    padding: 5rem 5%;
    background: linear-gradient(135deg, #f5f9ff, #e8f0ff);
}

.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.calculator-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.calc-tab {
    padding: 0.8rem 1.5rem;
    border: none;
    background: var(--light);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.calc-tab.active {
    background: var(--secondary);
    color: white;
}

/* Testimonials */
.testimonials {
    padding: 5rem 5%;
    background: white;
}

.testimonial-carousel {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.testimonial-track {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonial-card {
    min-width: 100%;
    padding: 2rem;
    background: var(--light);
    border-radius: 10px;
    text-align: center;
}

.client-rating {
    color: var(--warning);
    margin-bottom: 1rem;
}

.client-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.client-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* Partners Section */
.partners-section {
    padding: 5rem 5%;
    background: var(--light);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
    min-width: 0;
}

.partner-logo {
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.partner-logo img {
    max-width: 100%;
    height: 44px;
    object-fit: contain;
    filter: grayscale(0.1);
}

@media (max-width: 1200px) {
    .partners-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .partners-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Mobile / small tablet: three partner logos per row */
@media (max-width: 768px) {
    .partners-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem 0.75rem;
    }

    .partner-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 5.25rem;
        padding: 0.65rem 0.55rem;
        box-sizing: border-box;
    }

    .partner-logo img {
        height: auto;
        max-height: 62px;
        width: auto;
        max-width: 100%;
    }

    /* Last row has a single logo: center it in the middle column */
    .partners-grid .partner-logo:nth-last-child(1):nth-child(3n + 1) {
        grid-column: 2;
    }
}

@media (max-width: 600px) {
    .partners-grid {
        gap: 0.85rem 0.65rem;
    }

    .partner-logo {
        min-height: 4.75rem;
        padding: 0.55rem 0.5rem;
    }

    .partner-logo img {
        max-height: 56px;
    }
}

/* iPad Air: Our Partners — larger cells (before Pro so overlapping widths still get Pro rules after) */
@media (min-width: 800px) and (max-width: 834px) and (orientation: portrait) and (min-height: 1000px),
       (min-width: 1160px) and (max-width: 1220px) and (orientation: landscape) and (max-height: 950px) {
    .partners-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.35rem 1.2rem;
    }

    .partner-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 6rem;
        padding: 1.1rem 1.45rem;
        box-sizing: border-box;
    }

    .partner-logo img {
        height: auto;
        max-height: 72px;
        width: auto;
        max-width: 100%;
    }

    .partners-grid .partner-logo:nth-last-child(1):nth-child(3n + 1) {
        grid-column: 2;
    }
}

/* iPad Pro + Surface Pro 7 viewports: partners grid (same @media list as index Pro block) */
@media (min-width: 826px) and (max-width: 848px) and (orientation: portrait) and (min-height: 1060px),
       (min-width: 996px) and (max-width: 1080px) and (orientation: portrait) and (min-height: 1200px),
       (min-width: 1186px) and (max-width: 1235px) and (orientation: landscape) and (max-height: 940px),
       (min-width: 1310px) and (max-width: 1425px) and (orientation: landscape) and (min-height: 940px) and (max-height: 1080px),
       (min-width: 1345px) and (max-width: 1392px) and (min-height: 840px) and (max-height: 980px) and (orientation: landscape),
       (min-width: 878px) and (max-width: 958px) and (min-height: 1288px) and (max-height: 1410px) and (orientation: portrait) {
    .partners-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.35rem 1.2rem;
    }

    .partner-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 6rem;
        padding: 1.1rem 1.45rem;
        box-sizing: border-box;
    }

    .partner-logo img {
        height: auto;
        max-height: 72px;
        width: auto;
        max-width: 100%;
    }

    /* 28 logos → last row single tile: center in middle column */
    .partners-grid .partner-logo:nth-last-child(1):nth-child(3n + 1) {
        grid-column: 2;
    }
}

/* Enhanced Process Steps */
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    position: relative;
}

.step {
    text-align: center;
    position: relative;
}

.step-icon {
    width: 100px;
    height: 100px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    font-size: 2rem;
    color: var(--primary);
    transition: var(--transition);
}

.step:hover .step-icon {
    background: var(--secondary);
    color: white;
    transform: scale(1.1);
}

.step-number {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 30px;
    height: 30px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Newsletter Section */
.newsletter {
    padding: 5rem 5%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.newsletter-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-form .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.newsletter-form input[type="email"] {
    flex: 1 1 200px;
    min-width: 0;
    padding: 1rem;
    border: none;
    border-radius: 5px;
}

/* Trust Badges */
.trust-badges {
    padding: 3rem 5%;
    background: white;
}

.badges-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 5px;
    transition: var(--transition);
}

.badge-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow);
}

.badge-item i {
    font-size: 2rem;
    color: var(--secondary);
}

/* Comparison Table */
.comparison-section {
    padding: 5rem 5%;
    background: var(--light);
}

.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.comparison-table th {
    background: var(--primary);
    color: white;
    padding: 1rem;
}

.comparison-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.comparison-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.comparison-table .fa-check {
    color: var(--success);
}

.comparison-table .fa-times {
    color: var(--danger);
}

/* FAQ Section */
.home-faq {
    padding: 5rem 5%;
    background: white;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--light);
    border-radius: 5px;
    margin-bottom: 1rem;
    overflow: hidden;
    cursor: pointer;
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
}

.faq-answer {
    max-height: 0;
    padding: 0 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 1.5rem;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .newsletter-form .form-group {
        flex-direction: column;
    }

    .badges-container {
        grid-template-columns: 1fr;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   TABLET CONSISTENCY (769px-1024px)
   Keep desktop-style UI while preventing tablet overflow/crowding.
   ===================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .page-header,
    .newsletter,
    .comparison-section,
    .home-faq,
    .trust-badges {
        padding-left: 4%;
        padding-right: 4%;
    }

    .section-title {
        margin-bottom: 2.25rem;
    }

    .badges-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .process-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .footer-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .detail-content {
        padding-left: 4%;
        padding-right: 4%;
    }

    .detail-grid {
        grid-template-columns: minmax(320px, 54%) minmax(0, 1fr) !important;
        gap: 1.75rem !important;
    }

    .detail-image {
        height: 340px !important;
    }

    .detail-text p {
        max-width: none;
    }
}

/* ===== Product detail pages: fixed image frame (container size stays constant) ===== */
.detail-image {
    height: 490px;
    min-height: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    background: #f5f9ff;
}

.detail-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none;
    object-fit: contain !important;
    object-position: center;
}

@media (max-width: 1024px) {
    .detail-image {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .detail-image {
        height: 240px;
    }
}

@media (max-width: 480px) {
    .detail-image {
        height: 220px;
    }
}

/* =====================================================================
   MOBILE CONSISTENCY (phones: max-width 767px only)
   Tablet (768px) and desktop (>=769px) keep existing layouts.
   Targets: safe-area insets, overflow, footer stack, fluid gutters.
   ===================================================================== */
@media (max-width: 767px) {
    .contact-info li {
        align-items: flex-start;
    }

    .footer {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
        padding-top: clamp(2.5rem, 8vw, 4rem);
    }

    .footer-container {
        grid-template-columns: 1fr;
        min-width: 0;
        gap: 1.5rem;
    }

    .page-header {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }

    .partners-section {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }

    /* Avoid long URLs/emails forcing horizontal scroll in common text blocks */
    .footer-section p,
    .footer-section a,
    .contact-info a,
    .contact-info li {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 425px) {
    .footer,
    .page-header,
    .partners-section {
        padding-left: max(0.9rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.9rem, env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 375px) {
    .footer,
    .page-header,
    .partners-section {
        padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 320px) {
    .footer,
    .page-header,
    .partners-section {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }
}

/* =====================================================================
   FULL-PROJECT RESPONSIVE SAFETY NET
   Centralized cross-page layout guards for small desktop, tablet, mobile,
   and ultra-wide desktop screens.
   ===================================================================== */

/* Small desktop / laptop */
@media (min-width: 1025px) and (max-width: 1280px) {
    .service-detail-container,
    .about-grid,
    .mv-container,
    .form-container,
    .quote-container,
    .blog-container,
    .home-contact-grid,
    .why-choose-inner {
        gap: 2rem !important;
    }

    .hero-categories {
        gap: 2.25rem !important;
    }

    .detail-grid {
        grid-template-columns: minmax(360px, 54%) minmax(0, 1fr) !important;
        gap: 2rem !important;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .about-content,
    .mission-vision,
    .team,
    .blog-section,
    .quote-section,
    .why-choose-quote,
    .insurance-types,
    .contact-info-section,
    .contact-form-section,
    .map-section,
    .faq-section,
    .service-categories,
    .service-detail,
    .process-section,
    .property-content,
    .products-grid,
    .claims-process {
        padding-left: 4%;
        padding-right: 4%;
    }

    .about-grid,
    .mv-container,
    .blog-container,
    .service-detail-container,
    .form-container,
    .quote-container {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
    }

    .about-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }

    .contact-grid,
    .features-grid,
    .types-grid,
    .team-grid,
    .process-grid,
    .faq-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }

    .faq-grid {
        grid-template-columns: 1fr !important;
    }

    .coverage-buttons {
        column-gap: 1rem !important;
        row-gap: 1.25rem !important;
    }

    .coverage-btn {
        flex: 0 1 calc((100% - 1rem) / 2) !important;
        max-width: none !important;
        min-height: 160px !important;
    }

    .service-image::before,
    .about-image::before {
        display: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .about-grid,
    .mv-container,
    .blog-container,
    .service-detail-container,
    .form-container,
    .quote-container,
    .contact-grid,
    .features-grid,
    .types-grid,
    .team-grid,
    .process-grid,
    .faq-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .post-footer,
    .testimonial-author,
    .hours-item {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .post-tags {
        flex-wrap: wrap;
    }

    .coverage-btn {
        flex: 0 1 100% !important;
        max-width: none !important;
    }

    .about-stat h3 {
        font-size: 2rem;
    }

    .map {
        height: 320px;
    }

    .back-home {
        top: 1rem;
        left: 1rem;
        font-size: 0.9rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .map {
        height: 280px;
    }

    .contact-icon,
    .mv-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .login-wrap {
        max-width: 100%;
    }
}

/* Large / ultra-wide desktops */
@media (min-width: 1536px) {
    .about-hero-content,
    .about-grid,
    .mv-container,
    .team-grid,
    .blog-container,
    .contact-grid,
    .form-container,
    .map-container,
    .faq-grid,
    .quote-container,
    .features-grid,
    .types-grid,
    .service-detail-container,
    .process-grid,
    .property-shell,
    .detail-shell,
    .detail-grid,
    .home-contact-grid,
    .why-choose-inner {
        max-width: 1560px !important;
    }
}

/* =====================================================================
   TABLET + BROWSER COMPATIBILITY LAYER
   Scope: common tablet widths (601px-1024px), all major browsers.
   Goal: avoid overflow, improve tap targets, keep balanced 2-column grids.
   ===================================================================== */
@media (min-width: 601px) and (max-width: 1024px) {
    html,
    body {
        overflow-x: hidden;
    }

    /* Keep horizontal gutters consistent on tablets across pages */
    .page-header,
    .newsletter,
    .comparison-section,
    .home-faq,
    .trust-badges,
    .about-content,
    .mission-vision,
    .team,
    .blog-section,
    .quote-section,
    .why-choose-quote,
    .insurance-types,
    .contact-info-section,
    .contact-form-section,
    .map-section,
    .faq-section,
    .service-categories,
    .service-detail,
    .process-section,
    .property-content,
    .products-grid,
    .claims-process,
    .partners-section,
    .footer {
        padding-left: clamp(1rem, 3.2vw, 2rem);
        padding-right: clamp(1rem, 3.2vw, 2rem);
    }

    /* Browser-safe shrink behavior for flex/grid children with long text */
    .about-grid > *,
    .mv-container > *,
    .blog-container > *,
    .service-detail-container > *,
    .form-container > *,
    .quote-container > *,
    .contact-grid > *,
    .features-grid > *,
    .types-grid > *,
    .team-grid > *,
    .process-grid > *,
    .faq-grid > *,
    .home-contact-grid > *,
    .why-choose-inner > * {
        min-width: 0;
    }

    /* Better touch targets on tablets */
    .nav-menu a,
    .quote-btn,
    .btn,
    button,
    [role="button"] {
        min-height: 44px;
    }
}

/* Tablet navigation spacing: desktop menu remains visible, no crowding */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        gap: clamp(0.6rem, 1.4vw, 1.2rem);
    }

    .nav-menu {
        gap: clamp(0.6rem, 1.2vw, 1.05rem);
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-menu a {
        font-size: clamp(0.84rem, 1vw, 0.95rem);
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        white-space: nowrap;
    }

    /* Keep dropdowns inside viewport in Safari/Firefox zoom scenarios */
    .nav-dropdown {
        max-width: min(92vw, 340px);
    }
}

/* iPad Air: full nav + Get Quote on one row; stable bar (same rules as Pro; Air-only widths) */
@media (min-width: 800px) and (max-width: 834px) and (orientation: portrait) and (min-height: 1000px),
       (min-width: 1160px) and (max-width: 1220px) and (orientation: landscape) and (max-height: 950px) {
    .navbar,
    .navbar.scrolled {
        transition: none !important;
    }

    .nav-container {
        flex-wrap: nowrap;
        gap: clamp(0.35rem, 1vw, 0.7rem);
        padding: 0.45rem clamp(0.75rem, 3.5%, 1.25rem);
        box-sizing: border-box;
    }

    .navbar.scrolled .nav-container {
        padding: 0.45rem clamp(0.75rem, 3.5%, 1.25rem) !important;
    }

    .nav-menu {
        flex-wrap: nowrap !important;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
        gap: clamp(0.3rem, 1.1vw, 0.65rem);
    }

    .nav-menu a {
        font-size: clamp(0.78rem, 1.85vw, 0.9rem);
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    .nav-menu a.quote-btn {
        padding: 0.42rem 0.95rem;
        font-size: clamp(0.78rem, 1.85vw, 0.9rem);
        white-space: nowrap;
    }

    .navbar-logo-container {
        flex-shrink: 0;
    }

    .logo-img {
        height: clamp(52px, 8vw, 60px);
    }
}

/* Surface Duo / foldables — Edge viewport segments (see index.html home intro) */
@media (horizontal-viewport-segments: 2) {
    .navbar,
    .navbar.scrolled {
        transition: none !important;
    }

    .nav-container {
        flex-wrap: nowrap;
        gap: clamp(0.25rem, 1vw, 0.55rem);
        padding: 0.4rem max(0.45rem, env(safe-area-inset-left, 0px)) 0.4rem max(0.45rem, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    .navbar.scrolled .nav-container {
        padding: 0.4rem max(0.45rem, env(safe-area-inset-left, 0px)) 0.4rem max(0.45rem, env(safe-area-inset-right, 0px)) !important;
    }

    .nav-menu {
        flex-wrap: nowrap !important;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
        gap: clamp(0.15rem, 0.7vw, 0.45rem);
    }

    .nav-menu a {
        font-size: clamp(0.68rem, 1.35vw, 0.8rem);
        padding-left: 0.1rem;
        padding-right: 0.1rem;
    }

    .nav-menu a.quote-btn {
        padding: 0.32rem 0.62rem;
        font-size: clamp(0.68rem, 1.35vw, 0.8rem);
        white-space: nowrap;
    }

    .logo-img {
        height: clamp(42px, 6.5vw, 50px);
    }

    .partners-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 0.75rem;
    }

    .partner-logo {
        min-height: 4.75rem;
        padding: 0.65rem 0.85rem;
    }

    .partner-logo img {
        max-height: 52px;
    }
}

@media (vertical-viewport-segments: 2) {
    .partners-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem 0.65rem;
    }

    .partner-logo {
        min-height: 4.5rem;
        padding: 0.55rem 0.7rem;
    }

    .partner-logo img {
        max-height: 48px;
    }

    .nav-container {
        flex-wrap: nowrap;
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    }

    .nav-menu {
        flex-wrap: nowrap !important;
        flex: 1 1 auto;
        min-width: 0;
        gap: clamp(0.12rem, 0.6vw, 0.4rem);
    }

    .nav-menu a {
        font-size: clamp(0.66rem, 1.25vw, 0.78rem);
    }

    .nav-menu a.quote-btn {
        padding: 0.28rem 0.55rem;
        font-size: clamp(0.66rem, 1.25vw, 0.78rem);
    }

    .logo-img {
        height: clamp(40px, 6vw, 48px);
    }
}

/* iPad Pro + Surface Pro 7 viewports: nav one row (same @media list as index Pro block) */
@media (min-width: 826px) and (max-width: 848px) and (orientation: portrait) and (min-height: 1060px),
       (min-width: 996px) and (max-width: 1080px) and (orientation: portrait) and (min-height: 1200px),
       (min-width: 1186px) and (max-width: 1235px) and (orientation: landscape) and (max-height: 940px),
       (min-width: 1310px) and (max-width: 1425px) and (orientation: landscape) and (min-height: 940px) and (max-height: 1080px),
       (min-width: 1345px) and (max-width: 1392px) and (min-height: 840px) and (max-height: 980px) and (orientation: landscape),
       (min-width: 878px) and (max-width: 958px) and (min-height: 1288px) and (max-height: 1410px) and (orientation: portrait) {
    /* No layout jump when .scrolled toggles (global rule tightens padding + animates via transition) */
    .navbar,
    .navbar.scrolled {
        transition: none !important;
    }

    .nav-container {
        flex-wrap: nowrap;
        gap: clamp(0.35rem, 1vw, 0.7rem);
        padding: 0.45rem clamp(0.75rem, 3.5%, 1.25rem);
        box-sizing: border-box;
    }

    .navbar.scrolled .nav-container {
        padding: 0.45rem clamp(0.75rem, 3.5%, 1.25rem) !important;
    }

    .nav-menu {
        flex-wrap: nowrap !important;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
        gap: clamp(0.3rem, 1.1vw, 0.65rem);
    }

    .nav-menu a {
        font-size: clamp(0.78rem, 1.85vw, 0.9rem);
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    .nav-menu a.quote-btn {
        padding: 0.42rem 0.95rem;
        font-size: clamp(0.78rem, 1.85vw, 0.9rem);
        white-space: nowrap;
    }

    .navbar-logo-container {
        flex-shrink: 0;
    }

    .logo-img {
        height: clamp(52px, 8vw, 60px);
    }
}