/*
 * Construction Buddies LLC - Main Stylesheet
 * https://cbco.pro
 */

/* =============================================
   CSS Custom Properties (Design Tokens)
   ============================================= */
:root {
    /* Layout dimensions */
    --top-bar-height: 36px;
    --top-bar-height-mobile: 30px;
    --header-height: 70px;
    --header-offset: var(--top-bar-height);
    --content-offset: calc(var(--top-bar-height) + var(--header-height));
    --hero-top-padding: 160px;
    --hero-top-padding-mobile: 140px;

    /* Colors */
    --color-primary: #108378;
    --color-primary-dark: #0a5f56;
    --color-primary-accessible: #0d6b62; /* 4.75:1 contrast on #f8f9fa - passes WCAG AA */
    --color-gold: #ffd700;
    --color-gold-light: #ffe44d; /* Better contrast for accessibility */
    --color-gold-accessible: #ffe066; /* 4.01:1 contrast on teal - passes WCAG AA for large text */
    --color-text-muted: #666666; /* 5.74:1 contrast on white - passes WCAG AA */
}

/* =============================================
   Base Styles & Reset
   ============================================= */
html {
    /* scroll-behavior on html (not body) for Safari/WebKit compatibility */
    scroll-behavior: smooth;
}

/* Anchor link offset for fixed header - prevents content from being hidden behind header */
#about,
#services,
#testimonials,
#gallery,
#contact {
    scroll-margin-top: var(--content-offset);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Button reset for semantic buttons styled as cards/divs */
button.service-card,
button.gallery-item,
button.mobile-menu-toggle {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    text-align: inherit;
    width: 100%;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   Header
   ============================================= */
/* Top Bar */
.top-bar {
    background: #0a5f56;
    color: white;
    padding: 8px 0;
    text-align: center;
    font-size: 0.9rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1001;
}

.top-bar a {
    color: white;
    text-decoration: none;
}

.top-bar-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: var(--top-bar-height);
    z-index: 1000;
    will-change: background, backdrop-filter, -webkit-backdrop-filter;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.contact-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.cta-button {
    background: #108378;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
    will-change: background-color, transform;
}

.cta-button:hover {
    background: #0a5f56;
    transform: translateY(-2px);
}

/* =============================================
   Navigation Menu
   ============================================= */
nav {
    display: none;
}

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

nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #108378;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #108378;
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--content-offset);
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav.active {
    max-height: 400px;
}

.mobile-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.mobile-nav li {
    padding: 0;
}

.mobile-nav a {
    display: block;
    padding: 1rem 2rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s ease;
}

.mobile-nav a:hover {
    background: #f8f9fa;
    color: #108378;
}

/* =============================================
   Hero Section
   ============================================= */
.hero {
    position: relative;
    overflow: hidden;
    color: white;
    padding: 160px 0 80px; /* Increased to account for top bar + header */
    text-align: center;
    min-height: 600px; /* Ensure minimum height for slideshow */
}

/* Hero Slideshow */
.hero-slideshow {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: opacity 1s ease-in-out, visibility 0s 1s;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    display: block;
    transition: opacity 1s ease-in-out, visibility 0s 0s;
    z-index: 2;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: opacity 0.1s;
    }
}

/* Dark overlay for text contrast */
.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(16, 131, 120, 0.8) 0%, rgba(10, 95, 86, 0.85) 100%);
    z-index: 3;
}

/* Hero content above overlay */
.hero .container {
    position: relative;
    z-index: 4;
}

/* Slideshow controls */
.hero-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-pause-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.2s;
}

.hero-pause-btn:hover,
.hero-pause-btn:focus {
    background: rgba(255, 255, 255, 0.35);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.hero-indicators {
    display: flex;
    gap: 8px;
}

.hero-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.hero-indicator.active {
    background: white;
    transform: scale(1.3);
}

.hero-indicator:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Hero text styles */
.hero .hero-brand {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
    line-height: 1.2;
}

.hero .tagline {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-gold-light);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hero .subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* =============================================
   About Section
   ============================================= */
.about {
    padding: 80px 0;
    background: #f8f9fa;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    color: #108378;
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

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

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #108378;
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

/* =============================================
   Services Section
   ============================================= */
.services {
    padding: 80px 0;
}

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #108378;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    will-change: transform;
    overflow: hidden;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.service-card-content {
    padding: 1.5rem;
}

.service-card h3 {
    color: #108378;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: #666;
    line-height: 1.7;
}

.service-card-cta {
    display: inline-block;
    margin-top: 1rem;
    color: #108378;
    font-weight: bold;
    text-decoration: none;
}

.service-card-cta:hover {
    text-decoration: underline;
}

/* =============================================
   Testimonials Section
   ============================================= */
.testimonials {
    padding: 80px 0;
    background: #f8f9fa;
}

.testimonials h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #108378;
    margin-bottom: 3rem;
}

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

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
}

.testimonial-quote {
    font-size: 3rem;
    color: #108378;
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 20px;
}

.testimonial-text {
    font-style: italic;
    color: #666;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-author-initial {
    width: 50px;
    height: 50px;
    background: #108378;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.testimonial-author-info h4 {
    color: #333;
    margin-bottom: 0.25rem;
}

.testimonial-author-info p {
    color: var(--color-text-muted); /* #666666 - 5.74:1 contrast ratio, WCAG AA compliant */
    font-size: 0.9rem;
}

.testimonial-stars {
    color: #ffd700;
    margin-bottom: 1rem;
}

/* =============================================
   Gallery Section
   ============================================= */
.gallery {
    padding: 80px 0;
    background: #f8f9fa;
}

.gallery h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #108378;
    margin-bottom: 3rem;
}

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

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    cursor: pointer;
}

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 300px;
}

.before, .after {
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
}

.before::before,
.after::before {
    content: attr(data-label);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 1rem;
    text-align: center;
}

/* =============================================
   Service Detail Modal
   ============================================= */
.service-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    overflow-y: auto;
    padding: 20px 0;
}

.service-modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    position: relative;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.service-modal-header {
    position: relative;
}

.service-modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 15px 15px 0 0;
}

.service-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.service-modal-body {
    padding: 2rem;
}

.service-modal-body h2 {
    color: #108378;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.service-modal-body p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.service-modal-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.service-modal-features li {
    padding: 0.5rem 0;
    padding-left: 30px;
    position: relative;
    color: #333;
}

.service-modal-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #108378;
    font-weight: bold;
}

.service-modal-cta {
    margin-top: 2rem;
    text-align: center;
}

/* =============================================
   Before/After Comparison Modal
   ============================================= */
.comparison-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow-y: auto;
}

.comparison-modal-content {
    margin: 20px auto;
    padding: 20px;
    width: 95%;
    max-width: 900px;
    position: relative;
}

.comparison-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    z-index: 10;
}

.comparison-modal-title {
    color: white;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.comparison-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.comparison-images {
    position: relative;
    width: 100%;
    /* Use aspect-ratio instead of padding hack for better image handling */
    aspect-ratio: 4 / 3;
}

.comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use contain to show full image without cropping */
    object-fit: contain;
}

.comparison-image.before {
    z-index: 1;
    /* BEFORE shows RIGHT of slider - clip from left (at 50%, show right half) */
    clip-path: inset(0 0 0 50%);
}

.comparison-image.after {
    z-index: 2;
    /* AFTER shows LEFT of slider - clip from right (at 50%, show left half) */
    clip-path: inset(0 50% 0 0);
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.comparison-slider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.comparison-slider::after {
    content: "\25C4 \25BA";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #108378;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.comparison-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.comparison-label {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: bold;
}

/* Ensure modal images load properly */
.comparison-images img {
    max-width: 100%;
}

/* =============================================
   Contact Section
   ============================================= */
.contact {
    padding: 80px 0;
    background: #108378;
    color: white;
    text-align: center;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 280px min-width for email address */
    gap: 2rem;
    margin: 3rem 0;
}

.contact-method {
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 15px;
}

.contact-method h3 {
    margin-bottom: 1rem;
    color: var(--color-gold-accessible); /* #ffe066 - 4.01:1 contrast on teal, WCAG AA for large text */
    word-break: break-word;
    overflow-wrap: break-word;
}

.contact-method p {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Contact section CTA - Gold button stands out against teal background */
.contact .cta-button {
    background: var(--color-gold); /* Gold on teal for visibility */
    color: var(--color-primary-dark); /* Dark teal text for contrast */
}

.contact .cta-button:hover {
    background: var(--color-gold-light); /* Lighter gold on hover */
    color: var(--color-primary-dark);
}

/* =============================================
   Footer
   ============================================= */
footer {
    background: #000000;
    color: white;
    padding: 3rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #108378;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #108378;
}

.footer-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
}

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

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #108378;
}

/* =============================================
   Quote Modal
   ============================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: bold;
}

/* Optional field label indicator */
.optional-label {
    font-weight: normal;
    color: #666;
    font-size: 0.875em;
}

/* Privacy consent checkbox styling */
.privacy-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
}

.privacy-consent input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
}

.privacy-consent label {
    font-weight: normal;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* Honeypot field - hidden from real users */
.honeypot-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =============================================
   Loading Spinner
   ============================================= */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

/* =============================================
   Responsive Styles - Desktop
   ============================================= */
@media (min-width: 769px) {
    nav {
        display: block;
    }

    .desktop-cta {
        display: inline-block !important;
    }

    .header-content {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 2rem;
        align-items: center;
    }

    .contact-info {
        display: none;
    }
}

/* =============================================
   Responsive Styles - Tablet & Mobile
   ============================================= */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .desktop-cta {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    .contact-info {
        display: none;
    }

    .top-bar {
        font-size: 0.8rem;
        padding: 6px 0;
    }

    .top-bar-content {
        gap: 0.5rem;
    }

    .top-bar-content span:nth-child(2) {
        display: none; /* Hide separator on mobile */
    }

    header {
        top: var(--top-bar-height-mobile);
    }

    .mobile-nav {
        top: calc(var(--top-bar-height-mobile) + var(--header-height));
    }

    /* Anchor link offset for mobile fixed header */
    #about,
    #services,
    #testimonials,
    #gallery,
    #contact {
        scroll-margin-top: calc(var(--top-bar-height-mobile) + var(--header-height));
    }

    .hero {
        padding: 140px 0 60px; /* Account for top bar + header */
        min-height: 500px; /* Smaller min-height for mobile */
    }

    /* Mobile-specific hero slideshow fixes */
    .hero-slideshow {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .hero-slide {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    /* Ensure only active slide is visible on mobile - very aggressive */
    .hero-slide:not(.active) {
        opacity: 0 !important;
        visibility: hidden !important;
        display: none !important;
        pointer-events: none !important;
    }

    .hero-slide.active {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        pointer-events: auto !important;
    }

    .hero .hero-brand {
        font-size: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero .tagline {
        font-size: 1.1rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .hero-controls {
        bottom: 15px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-grid,
    .testimonials-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        min-width: 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-method h3 {
        font-size: 1.2rem;
        word-break: break-word;
    }

    .contact-method p {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 10px auto;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents iOS zoom on input focus */
    }
}

/* =============================================
   Responsive Styles - Small Mobile
   ============================================= */
@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

    .about h2,
    .services h2,
    .testimonials h2,
    .gallery h2,
    .contact h2 {
        font-size: 1.8rem;
    }

    .container {
        padding: 0 15px;
    }

    .before-after {
        height: 200px;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .service-card-image {
        height: 150px;
    }

    .service-modal-image {
        height: 200px;
    }

    .service-modal-body {
        padding: 1.5rem;
    }

    .service-modal-body h2 {
        font-size: 1.5rem;
    }

    .comparison-slider::before {
        width: 40px;
        height: 40px;
    }

    .comparison-slider::after {
        font-size: 12px;
    }
}
