/* ============================================================================
   GLOBAL CSS VARIABLES & BRANDING
   Based on "Express Truck Lube & REPAIRS" Logo
   ============================================================================ */
:root {
    /* --- BRAND COLORS --- */
    /* Deep Navy (Primary Dark - from "Express Truck Lube") */
    --brand-navy: #0F172A;
    /* Slate 900 equivalent - Professional, trusted */
    --brand-navy-light: #1E293B;
    /* Slate 800 */
    --brand-navy-dark: #020617;
    /* Slate 950 */

    /* Vibrant Orange (Primary Brand - from "& REPAIRS") */
    --brand-orange: #F97316;
    /* Orange 500 */
    --brand-orange-hover: #EA580C;
    /* Orange 600 */
    --brand-orange-light: #FFEDD5;
    /* Orange 100 */

    /* Flame Gradient (Secondary Accent - from Logo Icon) */
    --brand-red: #EF4444;
    /* Red 500 */
    --brand-yellow: #EAB308;
    /* Yellow 500 */
    --gradient-flame: linear-gradient(135deg, #EF4444 0%, #F97316 50%, #EAB308 100%);
    --gradient-flame-hover: linear-gradient(135deg, #DC2626 0%, #EA580C 50%, #CA8A04 100%);

    /* Cyan Drop (Tertiary Accent - from Logo Icon) */
    --brand-cyan: #06B6D4;
    /* Cyan 500 */
    --brand-cyan-dark: #0891B2;
    /* Cyan 600 */
    --gradient-water: linear-gradient(180deg, #06B6D4 0%, #3B82F6 100%);

    /* --- NEUTRALS --- */
    --neutral-white: #FFFFFF;
    --neutral-50: #F8FAFC;
    /* Very Light Blue-Gray background */
    --neutral-100: #F1F5F9;
    /* Borders/Separators */
    --neutral-200: #E2E8F0;
    --neutral-300: #CBD5E1;
    --neutral-400: #94A3B8;
    /* Muted Text */
    --neutral-500: #64748B;
    --neutral-600: #475569;
    /* Body Text Main */
    --neutral-700: #334155;
    /* Headings Light */
    --neutral-800: #1E293B;
    --neutral-900: #0F172A;
    /* Headings Main */

    /* --- TYPOGRAPHY --- */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;

    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.1), 0 2px 4px -2px rgb(15 23 42 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.1), 0 4px 6px -4px rgb(15 23 42 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(15 23 42 / 0.1), 0 8px 10px -6px rgb(15 23 42 / 0.1);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.3);

    /* --- SPACING & RADIUS --- */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    /* Standard Button */
    --radius-lg: 0.75rem;
    /* Card */
    --radius-xl: 1rem;
    /* Large Card */
    --radius-full: 9999px;
    /* Pill */

    --container-padding: clamp(1rem, 5vw, 2rem);
    --navbar-height: 80px;
    --navbar-height-mobile: 70px;
    --topbar-height: 42px;
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--neutral-600);
    background-color: var(--neutral-50);
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--brand-navy);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    letter-spacing: -0.01em;
}

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

h4 {
    font-size: 1.25rem;
}

a {
    color: var(--brand-orange);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--brand-orange-hover);
}

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

/* Hide browser number input spinners so users type values directly. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ============================================================================
   COMPONENTS
   ============================================================================ */

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    gap: 0.5rem;
}

/* Brand Primary Button (Orange) */
.btn-primary {
    background-color: var(--brand-orange);
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.2);
}

.btn-primary:hover {
    background-color: var(--brand-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(249, 115, 22, 0.3);
    color: white !important;
}

/* Brand Secondary Button (Navy) */
.btn-secondary {
    background-color: var(--brand-navy);
    color: white !important;
}

.btn-secondary:hover {
    background-color: var(--brand-navy-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white !important;
}

/* Gradient Action Button (Flame) */
.btn-action {
    background: var(--gradient-flame);
    color: white !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-flame-hover);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-action:hover::before {
    opacity: 1;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.3);
    color: white !important;
}

/* Outline Button */
.btn-outline {
    background-color: transparent;
    border: 2px solid var(--brand-orange);
    color: var(--brand-orange);
}

.btn-outline:hover {
    background-color: var(--brand-orange);
    color: white;
}

/* --- TOP BAR --- */
.top-bar {
    background-color: var(--brand-navy-dark);
    color: var(--neutral-400);
    padding: 0;
    font-size: 0.85rem;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar .container {
    height: 100%;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.top-link-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}

.top-link-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    position: relative;
    color: var(--neutral-400);
    transition: color 0.2s ease;
}

.top-link-item a {
    color: inherit;
    font-weight: 500;
}

.top-phone-link {
    font-size: 0.6em;
}

.top-link-item:hover,
.top-link-item a:hover {
    color: var(--brand-orange);
}

.top-bar-btn {
    background: rgba(255, 255, 255, 0.08);
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    font-weight: 600;
    color: white !important;
    transition: all 0.2s ease;
}

.top-bar-btn:hover {
    background: var(--brand-orange);
    color: white !important;
}

/* --- MODERN NAVIGATION --- */
.navbar-main {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all 0.3s ease;
    height: var(--navbar-height);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.navbar-main .container-fluid {
    gap: 0.75rem;
}

.navbar-main.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    height: 70px;
    /* Shrink slightly on scroll */
}

.navbar-brand img {
    height: 48px;
    width: auto;
    transition: all 0.3s ease;
}

.navbar-main.scrolled .navbar-brand img {
    height: 42px;
}

@media (max-width: 991px) {
    .navbar-main {
        height: auto;
        padding: 0.75rem 1rem;
        box-shadow: var(--shadow-md);
    }

    .navbar-main .navbar-brand {
        gap: 0.5rem;
    }

    .navbar-main .navbar-brand img {
        height: 40px;
    }

    .navbar-main .navbar-brand span {
        font-size: 1rem;
        line-height: 1.2;
    }

    .navbar-main .navbar-toggler {
        margin-left: auto;
        border: 1px solid var(--neutral-200);
        background: #fff;
        color: var(--brand-navy);
    }
}

@media (max-width: 575px) {
    .navbar-main .navbar-brand span {
        /* Fluid font size: scales between 12px and 16px based on width */
        font-size: clamp(0.75rem, 4vw, 1rem);
        white-space: nowrap;
    }

    .navbar-main .navbar-brand img {
        /* Slightly smaller logo on mobile to save space */
        height: 32px;
    }

    .navbar-main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (max-width: 380px) {

    /* Critical small screens (iPhone SE, Fold, etc) */
    .navbar-main .navbar-brand span {
        font-size: clamp(0.65rem, 3.5vw, 0.85rem);
    }

    .navbar-main .navbar-brand img {
        height: 28px;
    }

    .navbar-main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Desktop Links */
.nav-link-custom {
    color: var(--brand-navy);
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
}

.nav-link-custom:hover,
.nav-link-custom.active {
    color: var(--brand-orange);
    background-color: rgba(249, 115, 22, 0.08);
}

/* Button in Navbar */
.nav-btn-highlight {
    padding: 0.6rem 1.5rem !important;
    margin-left: 1rem;
    box-shadow: var(--shadow-md);
    background-color: var(--brand-orange) !important;
    color: white !important;
    border: none !important;
    opacity: 1 !important;
}

.nav-btn-highlight:hover {
    background-color: var(--brand-orange-hover) !important;
    color: white !important;
    transform: translateY(-1px);
}

/* --- MOBILE OFFCANVAS --- */
.offcanvas-custom {
    background: var(--neutral-50);
    max-width: 85vw;
}

.offcanvas-header {
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid var(--neutral-200);
}

.offcanvas-body {
    padding: 0;
    overflow-y: auto;
}

.mobile-nav-list {
    list-style: none;
    padding: 1.5rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    color: var(--brand-navy);
    background: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    border: 1px solid var(--neutral-200);
    transition: all 0.2s ease;
}

.mobile-nav-link i {
    color: var(--brand-orange);
    opacity: 0.8;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: white;
    border-color: var(--brand-orange);
    color: var(--brand-orange);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.mobile-cta-group {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--neutral-200);
    margin-top: auto;
}

/* Hamburger Toggler */
.navbar-toggler {
    border: none;
    background: transparent;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--brand-navy);
    transition: background 0.2s ease;
}

.navbar-toggler:active {
    background: var(--neutral-200);
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* --- FOOTER --- */
.footer-main {
    background-color: var(--brand-navy);
    color: var(--neutral-300);
    padding-top: 5rem;
    padding-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Background pattern using existing image */
.footer-main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/static/images/services_section_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

/* Gradient fade at top of footer */
.footer-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 1), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Ensure footer content is above background */
.footer-main > * {
    position: relative;
    z-index: 2;
}

.footer-logo {
    margin-bottom: 1.5rem;
    max-width: 200px;
    filter: brightness(0) invert(1);
    /* Make logo white if it's an image, adapt if SVG */
}

.footer-heading {
    color: white;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
}

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

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

.footer-links a {
    color: var(--neutral-400);
    transition: padding-left 0.2s ease;
}

.footer-links a:hover {
    color: var(--brand-orange);
    padding-left: 0.25rem;
}

.footer-contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.footer-contact-icon {
    color: var(--brand-orange);
    margin-top: 0.2rem;
}

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

.social-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.2s ease;
}

.social-icon-btn:hover {
    background-color: var(--brand-orange);
    transform: translateY(-2px);
    color: white;
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.875rem;
}

/* --- UTILITIES --- */
.text-brand-orange {
    color: var(--brand-orange) !important;
}

.text-brand-navy {
    color: var(--brand-navy) !important;
}

.bg-brand-navy {
    background-color: var(--brand-navy) !important;
}

.bg-brand-orange {
    background-color: var(--brand-orange) !important;
}

.section-padding {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.shadow-card {
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-100);
    background: white;
}
