/* ==========================================
   ECHO HOME SERVICE - TECHNICAL FOUNDATION
   Mobile-First Responsive CSS Framework
   ========================================== */

/* CSS RESET & BASE */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    overflow-x: hidden;
}

/* ACCESSIBILITY */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* MOBILE-FIRST LAYOUT SYSTEM */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

/* RESPONSIVE BREAKPOINTS */
/* Tablet: 768px and up */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }

    .grid {
        gap: 2rem;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
    .container {
        padding: 0 3rem;
    }

    .grid {
        gap: 3rem;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* TYPOGRAPHY SYSTEM */
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, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
    margin-bottom: 1rem;
}

/* IMAGES - Performance & Responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy Loading Placeholder */
img[loading="lazy"] {
    background: #f0f0f0;
}

/* LINKS */
a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* BUTTONS - Mobile-First */
button,
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

button:focus,
.btn:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

@media (min-width: 768px) {

    button,
    .btn {
        padding: 1rem 2rem;
    }
}

/* SECTIONS */
section {
    padding: 3rem 0;
}

@media (min-width: 768px) {
    section {
        padding: 5rem 0;
    }
}

@media (min-width: 1024px) {
    section {
        padding: 7rem 0;
    }
}

/* HEADER - Sticky Navigation & Mobile Menu */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 0;
    transition: all 0.3s ease;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo-link {
    display: block;
    line-height: 0;
    z-index: 1002;
    /* Above mobile menu */
    position: relative;
}

.logo {
    height: auto;
    max-height: 45px;
    width: auto;
}

/* DESKTOP NAVIGATION */
.main-nav {
    display: none;
    /* Hidden on mobile */
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 2rem;
}

.nav-links li {
    position: relative;
    margin: 0;
    /* Override any defaults */
}

.nav-links a {
    color: #334155;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #F97316;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    border: 1px solid #e2e8f0;
    margin-top: 1rem;
    /* Gap for hover area */
}

/* Make sure hover works - invisible bridge */
.dropdown::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1.5rem;
    bottom: -1.5rem;
    left: 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: #475569;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: #fff7ed;
    color: #F97316;
}

/* Scrollable dropdown for Cities */
.dropdown-menu.scrollable {
    max-height: 400px;
    overflow-y: auto;
    width: 280px;
}

/* MOBILE MENU TOGGLE */
.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #333;
    z-index: 1002;
    padding: 0.5rem;
}

/* MOBILE DRAWER */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85vw;
    max-width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1001;
    transition: right 0.3s ease;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    box-sizing: border-box;
    text-align: left;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
}

.mobile-nav li {
    border-bottom: 1px solid #f1f5f9;
}

.mobile-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1.05rem;
    color: #334155;
    font-weight: 600;
}

.mobile-nav .dropdown-menu {
    position: static !important;
    /* Stack flow on mobile */
    box-shadow: none;
    border: none;
    opacity: 1;
    visibility: visible;
    transform: none !important;
    left: 0 !important;
    padding-left: 1rem;
    display: none;
    /* Hidden by default on mobile */
    background: #f8fafc;
    margin-top: 0;
    width: 100% !important;
}

.mobile-nav .dropdown-menu a {
    white-space: normal;
    /* Fix clipping */
    font-weight: 500;
    font-size: 0.95rem;
}

.mobile-nav .dropdown.open .dropdown-menu {
    display: block;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* RESPONSIVE */
@media (min-width: 1024px) {
    .main-nav {
        display: block;
    }

    .mobile-menu-btn {
        display: none;
    }

    .logo {
        max-height: 55px;
    }

    .nav-wrapper {
        height: 80px;
    }
}

/* BREADCRUMB NAVIGATION */
.breadcrumbs {
    background: #f8f8f8;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: #999;
}

.breadcrumbs a {
    color: #666;
}

.breadcrumbs a:hover {
    color: #000;
    text-decoration: underline;
}

.breadcrumbs li:last-child span {
    color: #333;
    font-weight: 500;
}


/* FOOTER */
footer {
    background: #f8f8f8;
    padding: 3rem 0 1rem;
}

/* HOMEPAGE SECTIONS */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f8f8f8;
}

.services-overview {
    background: #ffffff;
}

.service-card,
.benefit {
    padding: 2rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.why-choose {
    background: #f8f8f8;
}

.cta-section {
    background: #333;
    color: #fff;
}

.cta-section h2 {
    color: #fff;
}

/* CITY HOMEPAGE TEMPLATE SECTIONS */
.city-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
}

.local-intro {
    background: #fff;
}

.trust-signals {
    background: #f8f8f8;
}

.trust-item {
    text-align: center;
    padding: 2rem 1rem;
}

.trust-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.faq-section {
    background: #fff;
}

.faq-item {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid #333;
}

.faq-item h3 {
    margin-bottom: 0.5rem;
}

.nearby-cities {
    background: #f8f8f8;
}

.nearby-list {
    list-style: none;
    padding: 0;
}

.nearby-list li {
    padding: 0.5rem 0;
}

.nearby-list a {
    color: #333;
    font-weight: 500;
}

.nearby-list a:hover {
    color: #000;
    text-decoration: underline;
}


/* UTILITY CLASSES */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

@media (min-width: 768px) {
    .d-md-block {
        display: block;
    }

    .d-md-none {
        display: none;
    }
}

/* PERFORMANCE OPTIMIZATIONS */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {

    header,
    footer,
    nav {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
}

/* TRUST GRID - Mobile Optimization */
.trust-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

.trust-grid img {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
}

.trust-grid > div {
    text-align: center !important;
}

@media (min-width: 1024px) {
    .trust-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}