/* ===================================================================== */
/* MASTER LAYOUT CSS - Extracted from Homepage                          */
/* This file contains all master layout elements:                       */
/* - Header/Navigation (Desktop + Mobile)                               */
/* - Hero Section                                                       */
/* - Bottom CTA Section                                                 */
/* - Footer                                                              */
/* ===================================================================== */

/* ===================================================================== */
/* CSS VARIABLES & BASE STYLES                                          */
/* ===================================================================== */

:root {
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --background-primary: #ffffff;
    --background-secondary: #f8f9fa;
    --accent: #007aff;
    --accent-hover: #0051d5;
    --border-subtle: rgba(0, 0, 0, 0.04);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 20px rgba(0, 122, 255, 0.25);
    --footer-bg: #1d1d1f;
    --footer-text: #86868b;
    --footer-border: #424245;
}

/* Base styles for all pages using master layout */
.master-layout {
    background: var(--background-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Ensure header positioning works correctly */
.master-layout header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1001;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* Ensure sticky header works on mobile specifically */
@supports (position: sticky) or (position: -webkit-sticky) {
    .master-layout header {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* ===================================================================== */
/* HEADER / NAVIGATION                                                  */
/* ===================================================================== */

.master-layout .navbar {
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    width: 100%;
    transition: all 0.3s ease;
}

.master-layout .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

/* Logo Styling */
.master-layout .logo {
    display: flex;
    align-items: center;
    min-height: 46px;
}

.master-layout .logo-image {
    height: 42px;
    width: auto;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.master-layout .logo-image:hover {
    transform: scale(1.05);
}

/* Navigation Menu */
.master-layout .nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.master-layout .nav-menu li {
    position: relative;
}

.master-layout .nav-menu a {
    color: var(--text-primary);
    font-weight: 400;
    font-size: 15px;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 8px 0;
}

.master-layout .nav-menu a:hover,
.master-layout .nav-menu a.active {
    color: var(--accent);
    opacity: 1;
}

/* Dropdown Menu */
.master-layout .dropdown {
    position: relative;
}

.master-layout .dropdown-wrapper {
    display: inline-flex;
    align-items: center;
}

.master-layout .dropdown > a {
    display: inline-block;
}

.master-layout .dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.master-layout .dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.12);
    min-width: 200px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.master-layout .dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
}

.master-layout .dropdown-content a {
    display: block;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
}

.master-layout .dropdown-content a:hover {
    background: var(--background-secondary);
    color: var(--accent);
}

/* CTA Button in Nav */
.master-layout .cta-button {
    display: flex;
    align-items: center;
}

.master-layout .btn-primary {
    background: var(--accent);
    color: white;
    padding: 12px 22px;
    border-radius: 22px;
    font-weight: 400;
    font-size: 17px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    letter-spacing: -0.022em;
    text-decoration: none;
    display: inline-block;
}

.master-layout .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* Mobile Menu Toggle */
.master-layout .mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
    background: none;
    border: none;
}

.master-layout .mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.master-layout .mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.master-layout .mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===================================================================== */
/* HERO SECTION                                                         */
/* ===================================================================== */

.master-layout .page-hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-secondary);
    overflow: hidden;
}

.master-layout .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.master-layout .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 2;
}

.master-layout .hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.master-layout .hero-content h1 {
    color: white;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.master-layout .hero-content p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 19px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 30px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.master-layout .cta-button-large {
    background: var(--accent);
    color: white;
    padding: 16px 32px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 18px;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.master-layout .cta-button-large:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
    color: white;
}

/* ===================================================================== */
/* BOTTOM CTA SECTION                                                   */
/* ===================================================================== */

.master-layout .cta-section {
    background: var(--background-primary);
    padding: 100px 0;
    text-align: center;
}

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

.master-layout .cta-section h2 {
    font-size: 42px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.master-layout .cta-section p {
    font-size: 19px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================================================== */
/* FOOTER - MASTER TEMPLATE                                             */
/* ===================================================================== */

.master-layout footer,
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 40px;
}

.master-layout .footer-content,
.footer-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 40px;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 20px;
}

.master-layout .footer-section,
.footer-section {
    /* Base footer section styles */
}

.master-layout .footer-section h3,
.footer-section h3 {
    color: #f5f5f7;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 20px;
}

.master-layout .footer-section ul,
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.master-layout .footer-section li,
.footer-section li {
    margin-bottom: 8px;
}

.master-layout .footer-section a,
.footer-section a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.master-layout .footer-section a:hover,
.footer-section a:hover {
    color: #f5f5f7;
}

.master-layout .footer-section p,
.footer-section p {
    color: var(--footer-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.master-layout .business-hours,
.business-hours {
    margin-top: 10px;
}

.master-layout .hours-item,
.hours-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.master-layout .day,
.day {
    font-weight: 500;
    color: #c7c7cc;
}

.master-layout .time,
.time {
    color: var(--footer-text);
}

.master-layout .footer-map,
.footer-map {
    margin: 12px 0;
}

.master-layout .footer-map iframe,
.footer-map iframe {
    width: 100%;
    height: 120px;
    border: none;
    border-radius: 8px;
}

.master-layout .footer-bottom,
.footer-bottom {
    border-top: 1px solid var(--footer-border);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    color: var(--footer-text);
}

.master-layout .footer-bottom p,
.footer-bottom p {
    margin: 0;
    font-size: 13px;
}

/* ===================================================================== */
/* RESPONSIVE DESIGN                                                    */
/* ===================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .master-layout .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Prevent horizontal overflow that could show mobile menu */
    html, body {
        overflow-x: hidden;
        position: relative;
    }
    
    /* CRITICAL: Hide ALL navigation menus completely on mobile */
    .nav-menu,
    .master-layout .nav-menu,
    ul.nav-menu,
    .navbar .nav-menu,
    .nav-container .nav-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(-100vw) !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        z-index: -9999 !important;
        pointer-events: none !important;
    }
    
    /* Ensure sticky header on mobile */
    .master-layout header {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: saturate(180%) blur(20px) !important;
        -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    }
    
    /* Ensure navbar maintains height on mobile */
    .master-layout .navbar {
        min-height: 60px;
        position: relative;
    }
    
    .master-layout .nav-container {
        height: 60px;
        position: relative;
    }
    
    /* Mobile Navigation */
    .master-layout .mobile-menu-toggle {
        display: flex;
        order: 3;
    }
    
    /* Mobile Navigation - Create mobile menu from scratch */
    .master-layout .mobile-menu-toggle ~ .nav-menu,
    .mobile-menu-toggle ~ .nav-menu,
    .master-layout .nav-menu,
    .nav-menu {
        display: none !important;
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(-100vw) !important;
        clip: rect(0, 0, 0, 0) !important;
        overflow: hidden !important;
        z-index: -1 !important;
    }
    
    /* Mobile menu active state - only show when explicitly activated */
    .master-layout .mobile-menu-toggle ~ .nav-menu.active,
    .mobile-menu-toggle ~ .nav-menu.active,
    .master-layout .nav-menu.active,
    .nav-menu.active {
        display: flex !important;
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 60px) !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: saturate(180%) blur(20px) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        padding: 20px !important;
        z-index: 9999 !important;
        gap: 0 !important;
        margin: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        clip: auto !important;
        overflow: auto !important;
        pointer-events: auto !important;
    }
    
    /* Mobile menu list items - only apply when menu is active */
    .master-layout .mobile-menu-toggle ~ .nav-menu.active li,
    .mobile-menu-toggle ~ .nav-menu.active li,
    .master-layout .nav-menu.active li,
    .nav-menu.active li {
        border-bottom: 1px solid var(--border-subtle) !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        clip: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        height: auto !important;
    }
    
    .master-layout .mobile-menu-toggle ~ .nav-menu.active li:last-child,
    .mobile-menu-toggle ~ .nav-menu.active li:last-child,
    .master-layout .nav-menu.active li:last-child,
    .nav-menu.active li:last-child {
        border-bottom: none !important;
    }
    
    .master-layout .mobile-menu-toggle ~ .nav-menu.active a,
    .mobile-menu-toggle ~ .nav-menu.active a,
    .master-layout .nav-menu.active a,
    .nav-menu.active a {
        display: block !important;
        padding: 16px 20px !important;
        font-size: 16px !important;
        text-align: center !important;
        opacity: 1 !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        clip: auto !important;
        width: auto !important;
        height: auto !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    
    /* Mobile Dropdown */
    .master-layout .dropdown-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        position: relative;
    }
    
    .master-layout .dropdown > a {
        display: block;
        padding: 16px 20px;
        font-size: 16px;
        text-align: center;
        flex: 1;
    }
    
    .master-layout .dropdown-toggle {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        padding: 10px;
        color: var(--text-secondary);
        background: none;
        border: none;
        cursor: pointer;
        transition: transform 0.3s ease, color 0.3s ease;
    }
    
    .master-layout .dropdown.mobile-active .dropdown-toggle {
        transform: translateY(-50%) rotate(180deg);
        color: var(--accent);
    }
    
    .master-layout .dropdown-content {
        position: static;
        transform: none;
        background: rgba(248, 246, 243, 0.95);
        border-radius: 0 0 8px 8px;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        opacity: 1;
        visibility: visible;
    }
    
    .master-layout .dropdown.mobile-active .dropdown-content {
        max-height: 200px;
        padding: 8px 0;
    }
    
    .master-layout .dropdown-content a {
        padding: 12px 20px;
        text-align: center;
        border-bottom: 1px solid var(--border-subtle);
    }
    
    .master-layout .dropdown-content a:last-child {
        border-bottom: none;
    }
    
    .master-layout .cta-button {
        display: none;
    }
    
    /* Mobile Hero */
    .master-layout .page-hero {
        min-height: 400px;
        overflow-x: hidden;
    }
    
    /* Apply overflow control to main content sections */
    .master-layout main {
        overflow-x: hidden;
    }
    
    .master-layout .page-content {
        overflow-x: hidden;
    }
    
    .master-layout .hero-content h1 {
        font-size: 36px;
    }
    
    .master-layout .hero-content p {
        font-size: 17px;
    }
    
    /* Mobile CTA Section */
    .master-layout .cta-section {
        padding: 60px 0;
    }
    
    .master-layout .cta-section h2 {
        font-size: 32px;
    }
    
    /* Mobile Footer - Master Template */
    .master-layout .footer-content,
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 25px;
    }
    
    .master-layout footer,
    footer {
        padding: 50px 0 30px;
        overflow-x: hidden;
    }
    
    .master-layout .cta-section {
        overflow-x: hidden;
    }
    
    .master-layout .footer-section,
    .footer-section {
        text-align: center;
        padding: 0 10px;
    }
    
    .master-layout .footer-section h3,
    .footer-section h3 {
        margin-bottom: 24px;
        font-size: 18px;
    }
    
    .master-layout .footer-section p,
    .footer-section p {
        margin-bottom: 16px;
        font-size: 15px;
        line-height: 1.6;
    }
    
    .master-layout .footer-section ul,
    .footer-section ul {
        margin-bottom: 20px;
    }
    
    .master-layout .footer-section li,
    .footer-section li {
        margin-bottom: 12px;
    }
    
    .master-layout .footer-section a,
    .footer-section a {
        font-size: 15px;
    }
    
    .master-layout .business-hours,
    .business-hours {
        margin-top: 20px;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .master-layout .hours-item,
    .hours-item {
        justify-content: space-between;
        margin-bottom: 12px;
        font-size: 14px;
        padding: 0 20px;
    }
    
    .master-layout .footer-map,
    .footer-map {
        margin: 20px auto;
        max-width: 300px;
        display: block;
    }
    
    .master-layout .footer-map iframe,
    .footer-map iframe {
        height: 180px;
        width: 100%;
        border-radius: 12px;
    }
    
    .master-layout .footer-bottom,
    .footer-bottom {
        margin-top: 50px;
        padding: 25px 20px 0;
    }
    
    .master-layout .footer-bottom p,
    .footer-bottom p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Force center alignment for ALL footer content on mobile */
    footer,
    .footer-content,
    .footer-section,
    .footer-section h3,
    .footer-section p,
    .footer-section ul,
    .footer-section li,
    .footer-section a,
    .footer-map,
    .footer-bottom,
    .business-hours,
    .hours-item {
        text-align: center !important;
    }
    
    /* Specific overrides for flexbox items */
    .hours-item {
        justify-content: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    /* Center the map container */
    .footer-map {
        display: flex !important;
        justify-content: center !important;
        margin: 20px auto !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .master-layout .logo-image {
        height: 36px;
    }
    
    .master-layout .hero-content h1 {
        font-size: 28px;
    }
    
    .master-layout .cta-button-large {
        padding: 14px 28px;
        font-size: 16px;
    }
}

/* ===================================================================== */
/* FLEXIBLE CONTENT AREA                                                */
/* ===================================================================== */

/* This is where page-specific content goes */
.master-layout .page-content {
    /* Page-specific styles should be added here or in separate CSS files */
    /* The master layout ensures consistent header, hero, CTA, and footer */
}

/* Container utility class for content sections */
.master-layout .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section padding utility */
.master-layout .content-section {
    padding: 80px 0;
}

@media (max-width: 768px) {
    .master-layout .content-section {
        padding: 60px 0;
    }
}