/* ============================================================
   JERRY'S SPARE PARTS — PREMIUM DESIGN SYSTEM (BLUE & CLEAN)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,700;1,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Custom Properties */
/* -------------
   breakpoints are defined as CSS variables so you can tweak them
   in one place (e.g. switch to 600/900/1200 if you prefer).
   All media queries later reference these vars.
   ------------- */
:root {
    /* Swappable breakpoints */
    --bp-xs: 480px;
    --bp-sm: 640px;
    --bp-md: 768px;
    --bp-lg: 1024px;
    --bp-xl: 1280px;

    /* 🔵 FreyParts Inspired Palette */
    --primary: #0f4c81;
    /* Deep Professional Blue */
    --primary-dark: #0a3d66;
    --primary-light: #eff6ff;
    --primary-alpha: rgba(15, 76, 129, 0.1);

    /* Aliases for compatibility */
    --primary-blue: var(--primary);
    --primary-blue-alpha: var(--primary-alpha);

    --accent: #e31e24;
    /* Industrial Red preserved for secondary highlights */
    --accent-dark: #b91c1c;
    --accent-light: #fee2e2;

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Neutrals - Clean White Aesthetic matching FreyParts */
    --white: #ffffff;
    --black: #000000;
    --background: #ffffff;
    --surface: #f8f9fa;
    /* Light section backgrounds */
    --surface-dark: #f1f3f5;

    --text-dark: #1a1a1a;
    /* Primary text */
    --text-medium: #4a4a4a;
    --text-light: #6c757d;
    /* Secondary/muted text */

    --border: #e9ecef;
    --border-dark: #dee2e6;

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --overlay-gradient: linear-gradient(135deg, rgba(15, 76, 129, 0.85) 0%, rgba(15, 76, 129, 0.6) 100%);
    --dark-gradient: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);

    /* Aliases for compatibility with legacy styles */
    --gradient-overlay: var(--overlay-gradient);
    --gradient-primary: var(--primary-gradient);
    --gradient-dark: var(--dark-gradient);
    --gradient-hero: var(--overlay-gradient);
    --shadow-blue: 0 4px 15px rgba(15, 76, 129, 0.3);

    /* Typography */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-accent: 'Playfair Display', serif;

    /* Type Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.5rem;

    /* Font Weights */
    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    --weight-black: 900;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0em;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-8: 4rem;
    --space-10: 5rem;
    --space-12: 6rem;
    --space-16: 8rem;
    --space-20: 10rem;

    /* Section Spacing (Standardized for Figma feel) */
    --section-pad-y: 5rem;
    --section-pad-sm: 3rem;
    --section-pad-lg: 8rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;

    /* Layout */
    --container-max: 1440px;
    --container-pad: 2rem;
    --z-below: -1;
    --z-base: 1;
    --z-sticky: 1000;
    --z-dropdown: 1001;
    --z-modal: 2000;
    --z-toast: 3000;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* fluid base font size for small devices */
    font-size: clamp(15px, 1.5vw, 16px);
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: var(--space-3);
}

/* responsive heading scale for mobile devices */
h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 5vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h4 {
    font-size: clamp(1.25rem, 3vw, 2rem);
}

h5 {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

h6 {
    font-size: clamp(0.875rem, 2vw, 1.25rem);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
}

p {
    margin-bottom: var(--space-4);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ensure large elements never overflow on phones */
table,
pre,
blockquote,
code,
iframe,
video {
    max-width: 100%;
    overflow-x: auto;
}


ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

/* ── Layout Utilities ── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.container--sm {
    max-width: var(--container-sm);
}

.container--md {
    max-width: var(--container-md);
}

.container--lg {
    max-width: var(--container-lg);
}

.container--xl {
    max-width: var(--container-xl);
}

.section {
    /* use the semantic variable for easier tuning */
    padding: var(--section-pad-y) 0;
}

.section--sm {
    padding: var(--section-pad-sm) 0;
}

.section--lg {
    padding: var(--section-pad-lg) 0;
}

/* override any inline styles so spacing stays consistent */
.section {
    padding: var(--section-pad-y) 0 !important;
}

.section--sm {
    padding: var(--section-pad-sm) 0 !important;
}

.section--lg {
    padding: var(--section-pad-lg) 0 !important;
}

.section--lg {
    padding: clamp(var(--space-16), 8vw, var(--space-20)) 0;
}

.section--dark {
    background: var(--charcoal);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
    color: var(--white);
}

.section--darker {
    background: var(--black);
    color: var(--white);
}

.section--blue {
    background: var(--primary-blue);
    color: var(--black);
}

.section--off-white {
    background: var(--off-white);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-4);
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid--5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* more gap options */
.gap-3 { gap: var(--space-3); }
.gap-5 { gap: var(--space-5); }

/* Flex Utilities */
.flex {
    display: flex;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    align-items: center;
    justify-content: space-between;
}

.flex--col {
    flex-direction: column;
}

.flex--wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-white {
    color: var(--white);
}

.text-blue {
    color: var(--primary-blue);
}

.text-gold {
    color: var(--accent-gold-dark);
}

.text-gray {
    color: var(--medium-gray);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-lg {
    font-size: var(--text-lg);
}

.font-display {
    font-family: var(--font-display);
}

.font-accent {
    font-family: var(--font-accent);
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.font-bold {
    font-weight: var(--weight-bold);
}

.font-semibold {
    font-weight: var(--weight-semibold);
}

/* Visibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* background helpers for inline removal */
.bg-white { background: var(--white); }
.bg-surface { background: var(--surface); }
.bg-primary { background: var(--primary); }
.bg-primary-dark { background: var(--primary-dark); }
.bg-accent { background: var(--accent); color: var(--white); }

/* ── Section Headers ── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--primary-blue);
    margin-bottom: var(--space-2);
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gradient-blue);
    border-radius: 2px;
}

.section-title {
    font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
    font-weight: var(--weight-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-2);
}

.section-title span {
    color: var(--primary-blue);
}

.section--dark .section-title {
    color: var(--white);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--medium-gray);
    line-height: var(--leading-relaxed);
    max-width: 600px;
}

.section--dark .section-subtitle {
    color: rgba(255, 255, 255, 0.65);
}

.section-header {
    margin-bottom: var(--space-10);
}

.section-header--center {
    text-align: center;
}

.section-header--center .section-label {
    justify-content: center;
}

.section-header--center .section-subtitle {
    margin: 0 auto;
}

/* ── Skip Link ── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* ── Reduced Motion ── */
@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;
    }
}

/* ── Responsive Breakpoints ── */
@media (max-width: var(--bp-lg)) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: var(--bp-md)) {
    :root {
        --container-pad: 1rem;
    }

    .grid--4,
    .grid--3,
    .grid--2 {
        grid-template-columns: 1fr;
    }

    .grid {
        gap: var(--space-4); /* smaller gutters on narrow viewports */
    }

    .section {
        padding: var(--space-10) 0;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: var(--bp-xs)) {
    html {
        font-size: 15px;
    }
    :root {
        --container-pad: 0.75rem;
    }
    .hide-sm {
        display: none !important;
    }
}

/* additional utility for fluid text */
.fluid-text {
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
}

@media (max-width: 640px) {
    /* further compress header and hero spacing for phones */
    .site-header__inner {
        flex-direction: column;
        height: auto;
        padding: var(--space-2) var(--container-pad);
    }

    .site-header__inner .site-logo {
        margin-bottom: var(--space-2);
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hero,
    .page-hero,
    .hero-jerrys {
        padding: var(--space-16) 0 var(--space-12) !important;
    }

    h1, h2, h3, p {
        text-align: center;
    }

    /* additional small-screen stacking and centering rules */
    .grid--5,
    .grid--4,
    .grid--3,
    .grid--2,
    .grid--auto {
        grid-template-columns: 1fr !important;
    }

    .flex,
    .flex--between,
    .flex--center,
    .flex--col,
    .flex--wrap {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* guard against overflow */
    img, iframe, table, pre, code {
        max-width: 100%;
    }

    body {
        overflow-x: hidden;
    }
}

/* ── BRAND MARQUEE TEXT BADGES ── */
.brand-text-badge {
    display: inline-block;
    padding: 0.4rem 1.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--text-medium);
    text-transform: uppercase;
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.brand-text-badge:last-child {
    border-right: none;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ── STATS STRIP DIVIDERS ── */
@media (min-width: 768px) {
    .stat-item {
        border-right: 1px solid rgba(255, 255, 255, 0.15);
    }

    .stat-item:last-child {
        border-right: none;
    }
}

/* ── HOW-TO-ORDER STEP CONNECTION LINE (DESKTOP) ── */
@media (min-width: 768px) {
    .step-line {
        display: block !important;
    }
}