/* ═══════════════════════════════════════════════════
   Roofers Pasadena CA · Global Styles
   Terracotta & Slate Design System · 2026
   ═══════════════════════════════════════════════════ */

/* ── CSS Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* ── Design Tokens ── */
:root {
    /* Primary Palette – Charcoal Slate */
    --primary: #2D3436;
    --primary-dark: #1B1F21;
    --primary-light: #3D4447;

    /* Accent – Terracotta */
    --accent: #C0764A;
    --accent-dark: #A65D33;
    --accent-light: #D4956A;
    --accent-soft: rgba(192, 118, 74, .08);

    /* CTA – Golden Sand */
    --cta: #D4A259;
    --cta-hover: #C48E42;

    /* Backgrounds */
    --bg: #FAFAF7;
    --bg-alt: #F3F0EA;
    --card: #FFFFFF;

    /* Text */
    --text: #1A1A1A;
    --text-muted: #5A5A58;

    /* Borders & Shadows */
    --border: rgba(0, 0, 0, .08);
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, .08);
    --shadow-lg: 0 16px 50px rgba(0, 0, 0, .1);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* Keyboard, touch, and embedded-content resilience */
:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--cta);
    outline-offset: 3px;
}

button,
input,
select,
textarea {
    font: inherit;
}

iframe {
    max-width: 100%;
}

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

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

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.15rem;
    background: var(--accent-soft);
    border: 1px solid rgba(192, 118, 74, .18);
    border-radius: 9999px;
    color: var(--accent-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* ── Layout ── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45, 52, 54, .25);
}

.btn-cta {
    background: var(--cta);
    color: var(--primary-dark);
    font-weight: 700;
}

.btn-cta:hover {
    background: var(--cta-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 162, 89, .35);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-white {
    background: transparent;
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .7);
    color: #fff;
    transform: translateY(-1px);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.btn-lg {
    font-size: 0.95rem;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
}

/* ══════════════════════════
   HEADER
   ══════════════════════════ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 250, 247, .92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, .05);
    transition: box-shadow 0.3s;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 86px;
    gap: 1.5rem;
}

.header-logo img {
    display: block;
    height: 56px;
    width: auto;
}

@media (max-width: 480px) {
    .header-inner {
        height: 78px;
    }

    .header-logo img {
        height: 50px;
    }
}

.header-nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1024px) {
    .header-nav {
        display: flex;
    }
}

.nav-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* Dropdown */
.nav-item-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.nav-item-dropdown.is-open .dropdown-chevron {
    transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 680px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.mega-menu-wide {
    min-width: 860px;
}

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

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.mega-grid-4col {
    grid-template-columns: repeat(4, 1fr);
}

.mega-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(192, 118, 74, .12);
}

.mega-col-title svg {
    width: 16px;
    height: 16px;
}

.mega-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: 10px;
    transition: all 0.2s;
}

.mega-menu-item:hover {
    background: var(--accent-soft);
}

.mega-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 8px;
    flex-shrink: 0;
    color: var(--accent);
}

.mega-item-icon svg {
    width: 16px;
    height: 16px;
}

.mega-item-text {
    display: flex;
    flex-direction: column;
}

.mega-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.mega-item-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Mega Menu Footer */
.mega-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.mega-footer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.mega-footer-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.68rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mega-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mega-footer-call {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-dark);
    transition: color 0.2s;
}

.mega-footer-call svg {
    width: 16px;
    height: 16px;
}

.mega-footer-call:hover {
    color: var(--accent);
}

/* Header Actions */
.header-actions {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .header-actions {
        display: flex;
    }
}

.header-actions .btn svg {
    width: 16px;
    height: 16px;
}

/* Hamburger */
.hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
}

.hamburger svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 1024px) {
    .hamburger {
        display: none;
    }
}

/* ══════════════════════════
   MOBILE NAV
   ══════════════════════════ */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100%;
    background: var(--card);
    box-shadow: -8px 0 30px rgba(0, 0, 0, .12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow-y: auto;
}

.mobile-nav.active .mobile-nav-panel {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    flex: 1;
}

.mobile-nav-links > a {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
}

.mobile-nav-links > a:hover,
.mobile-nav-links > a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Mobile Dropdown */
.mobile-dropdown {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
}

.mobile-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
}

.mobile-dropdown-toggle.active .mobile-chevron {
    transform: rotate(180deg);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 0.75rem;
}

.mobile-submenu.open {
    max-height: 800px;
    padding-bottom: 0.5rem;
}

.mobile-submenu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s;
}

.mobile-submenu a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.mobile-submenu-all {
    font-weight: 700;
    color: var(--accent-dark) !important;
    margin-top: 0.25rem;
}

.mobile-nav-cta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* ── Mobile Sticky CTA ── */
.mobile-sticky-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--primary-dark);
    border-top: 1px solid rgba(255, 255, 255, .08);
}

@media (min-width: 1024px) {
    .mobile-sticky-cta {
        display: none;
    }
}

.btn-sticky-estimate,
.btn-sticky-call {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
    transition: background 0.2s;
}

.btn-sticky-estimate {
    background: var(--cta);
    color: var(--primary-dark);
}

.btn-sticky-call {
    background: var(--primary);
}

.btn-sticky-estimate svg,
.btn-sticky-call svg {
    width: 18px;
    height: 18px;
}

.btn-sticky-estimate:hover {
    background: var(--cta-hover);
}

.btn-sticky-call:hover {
    background: var(--primary-light);
}

/* ══════════════════════════
   FOOTER
   ══════════════════════════ */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, .7);
    padding: 4.5rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.3fr 1fr 1.2fr 1.1fr;
        gap: 2rem;
    }
}

.footer-brand {
    max-width: 360px;
}

.footer-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding: 8px 16px;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.footer-logo-badge img {
    height: 34px;
    width: auto;
    display: block;
}

.footer-desc {
    font-size: 0.85rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .65);
    margin-bottom: 1.5rem;
}

/* Social Media Icons */
.footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.footer-social-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.footer-social-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 118, 74, .35);
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    margin-bottom: 1.25rem;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, .65);
    transition: all 0.2s;
}

.footer-col ul li a:hover {
    color: #FFFFFF;
    padding-left: 4px;
}

/* Location / Contact items with icons */
.footer-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, .7);
    line-height: 1.5;
}

.footer-contact-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact-icon svg {
    width: 100%;
    height: 100%;
}

.footer-contact-item a {
    color: rgba(255, 255, 255, .85);
    transition: color 0.2s;
}

.footer-contact-item a:hover {
    color: var(--accent-light);
}

/* Map Container Card */
.footer-map-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    background: rgba(255, 255, 255, .04);
}

.footer-map-card iframe {
    display: block;
    width: 100%;
    height: 165px;
    border: none;
}

/* Bottom Bar */
.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, .5);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, .6);
    transition: color 0.2s;
}

.footer-bottom-links a:hover {
    color: #FFFFFF;
}

/* ── Scroll Padding for Fixed Header ── */
main {
    padding-bottom: 60px;
}

@media (min-width: 1024px) {
    main {
        padding-bottom: 0;
    }
}
