/* ==========================================================================
   Kriel & Newcombe Optometrists — "Visionary Heritage" Frontend Theme
   Design system: deep purple primary, warm whites, Playfair Display + Inter
   ========================================================================== */

/* ─────────────────────────────── 1. Design Tokens ─────────────────────────────── */
:root {
    /* Brand palette */
    --primary: #33144a;
    --on-primary: #ffffff;
    --primary-container: #4a2b61;
    --on-primary-container: #b994d2;
    --primary-fixed: #f3daff;
    --primary-fixed-dim: #dfb8f8;
    --on-primary-fixed: #2b0b41;
    --on-primary-fixed-variant: #593970;

    --secondary: #35618e;
    --on-secondary: #ffffff;
    --secondary-container: #9fcafd;
    --on-secondary-container: #275582;
    --secondary-fixed: #d1e4ff;
    --secondary-fixed-dim: #9fcafd;

    --tertiary: #656023;
    --tertiary-container: #b4ad68;

    --error: #ba1a1a;
    --on-error: #ffffff;
    --error-container: #ffdad6;
    --on-error-container: #93000a;

    --background: #fcf9f8;
    --on-background: #1c1b1b;
    --surface: #fcf9f8;
    --surface-dim: #dcd9d9;
    --surface-bright: #fcf9f8;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f6f3f2;
    --surface-container: #f0eded;
    --surface-container-high: #eae7e7;
    --surface-container-highest: #e5e2e1;
    --on-surface: #1c1b1b;
    --on-surface-variant: #4b444e;
    --inverse-surface: #313030;
    --inverse-on-surface: #f3f0ef;
    --inverse-primary: #dfb8f8;
    --outline: #7c747f;
    --outline-variant: #cdc3cf;
    --surface-variant: #e5e2e1;
    --surface-tint: #72518a;

    --warm-white: #F9F8F6;
    --lavender-mist: #F3F1F6;
    --cool-grey: #F0F2F5;
    --charcoal: #2D2D2D;

    /* Legacy aliases — kept so existing pages/plugins keep working */
    --primary-color: #33144a;
    --primary-hover: #4a2b61;
    --secondary-color: #35618e;
    --accent-color: #35618e;
    --text-color: #1c1b1b;
    --bg-color: #fcf9f8;
    --light-bg: #f6f3f2;
    --dark-bg: #33144a;
    --text-muted: #4b444e;
    --border-color: #e5e2e1;
    --nav-link: #33144a;
    --nav-hover: #35618e;
    --header-bg: #fcf9f8;
    --footer-bg: #33144a;
    --footer-text: #f3f0ef;
    --success: #2e7d32;
    --warning: #f9a825;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-accent: 'Plus Jakarta Sans', 'Inter', sans-serif;

    /* Layout */
    --container-max: 1280px;
    --margin-mobile: 20px;
    --margin-desktop: 64px;
    --gutter: 32px;
    --stack-sm: 8px;
    --stack-md: 24px;
    --stack-lg: 80px;

    /* Shape & elevation */
    --radius-sm: 20px;
    --radius: 20px;
    --radius-lg: 20px;
    --radius-xl: 20px;
    --shadow-ambient: 0 20px 45px rgba(51, 20, 74, 0.08);
    --shadow-card: 0 4px 20px rgba(51, 20, 74, 0.05);
}

/* ─────────────────────────────── 2. Base ─────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 26px;
    color: var(--on-surface);
    background: var(--warm-white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
    margin: 0 0 1rem;
}

p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; }
a { color: var(--secondary); }
a:hover { color: var(--primary); }

/* Neutralise the generic "card" treatment from frontend-style.css so the
   full-bleed sections render correctly under the new design. */
main { max-width: none; width: 100%; margin: 0; padding: 0; flex: 1; }
.site-main { width: 100%; }
section { background: transparent; border-radius: 0; padding: 0; box-shadow: none; margin: 0; }

/* ─────────────────────────────── 3. Layout ─────────────────────────────── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* ─────────────────────────────── 4. Top Contact Bar ─────────────────────────────── */
.topbar {
    background: var(--primary);
    color: var(--on-primary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--primary-container);
}
.topbar-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 0;
}
.topbar-item { display: inline-block; }
.topbar-item a { color: inherit; opacity: 0.92; transition: opacity 0.2s; }
.topbar-item a:hover { opacity: 1; color: inherit; }
.topbar-divider { color: var(--primary-fixed-dim); margin: 0 16px; }
@media (max-width: 767px) {
    .topbar-divider { display: none; }
    .topbar { letter-spacing: 0.03em; padding: 8px 14px; font-size: 10px; line-height: 1.4; }
    .topbar-inner { gap: 2px 0; }
}

/* ─────────────────────────────── 5. Site Header ─────────────────────────────── */
.site-header {
    background: rgba(249, 248, 246, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--surface-variant);
    box-shadow: 0 2px 12px rgba(51, 20, 74, 0.05);
}
.site-header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 20px var(--margin-desktop);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.site-logo { flex-shrink: 0; display: inline-flex; }
.site-logo img { height: 56px; width: auto; object-fit: contain; display: block; }

/* Primary navigation */
.site-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    row-gap: 8px;
}
.site-nav .menu-item > a {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--on-surface-variant);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.site-nav .menu-item > a:hover { color: var(--primary); }
.site-nav .menu-item.current-menu-item > a,
.site-nav .menu-item.current-menu-ancestor > a {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.site-nav .menu-item > a i.fa { font-size: 0.85em; }

/* CTA inside the nav (button-style) */
.site-nav-cta { margin-left: 4px; }
.site-nav-cta a { white-space: nowrap; }

/* Logo inline with the menu items (single row, desktop) */
/* Nav group sits on the right — space-between on the header puts the gap after the logo */
.site-logo + .site-nav { min-width: 0; }

/* Placeholder items & dropdown parents */
.nav-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-variant);
    padding-bottom: 4px;
    cursor: default;
}
.nav-dropdown-arrow { font-size: 0.7rem; margin-left: 4px; cursor: pointer; transition: transform 0.2s; }
.nav-dropdown-arrow.rotated { transform: rotate(180deg); }

/* Dropdown submenu */
.nav-dropdown { position: relative; }
.nav-dropdown .nav-dropdown-menu {
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}
.nav-dropdown .nav-dropdown-menu.open { display: flex; }

/* Hamburger (mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 0;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile navigation (below 768px) */
@media (max-width: 767px) {
    .site-header-inner { padding: 16px var(--margin-mobile); }
    .site-logo img { height: 44px; }

    .menu-toggle { display: flex; }

    .site-nav { order: 3; flex-basis: 100%; width: 100%; }
    .site-nav-list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--surface-variant);
        padding: 12px 0 4px;
    }
    .site-nav-list.open { display: flex; }

    .site-nav .menu-item { border-bottom: 1px solid var(--surface-variant); }
    .site-nav .menu-item:last-child { border-bottom: none; }
    .site-nav .menu-item > a {
        display: flex;
        width: 100%;
        padding: 14px 4px;
        border-bottom: none;
        justify-content: flex-start;
    }
    .site-nav .menu-item.current-menu-item > a { border-bottom: none; }

    .site-nav-cta { margin: 12px 0 8px; }
    .site-nav-cta a { width: 100%; }

    .nav-dropdown .nav-dropdown-menu { padding-left: 16px; }
    .nav-dropdown .nav-dropdown-menu li a { font-size: 13px; }
}

/* Desktop — centered logo above the menu: the header stacks vertically so the
   logo sits on its own centered row above the navigation (allows a larger logo). */
@media (min-width: 768px) {
    .site-header-inner {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 24px 32px 14px;
    }
    .site-logo img { height: 78px; }
    .site-nav-list { flex-wrap: nowrap; justify-content: center; gap: 18px; }
    .site-nav .menu-item > a { font-size: 12px; letter-spacing: 0.02em; }
    .site-nav-cta .btn { padding: 10px 15px; font-size: 12px; }
}

/* Narrow desktops — tightest readable sizing, scroll fallback if still tight */
@media (min-width: 768px) and (max-width: 1024px) {
    .site-header-inner { padding-left: 20px; padding-right: 20px; gap: 12px; }
    .site-logo img { height: 64px; }
    .site-nav-list { gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; justify-content: center; }
    .site-nav-list::-webkit-scrollbar { display: none; }
    .site-nav .menu-item > a { font-size: 10px; letter-spacing: 0; }
    .site-nav-cta .btn { padding: 7px 11px; font-size: 10px; }
}

/* ─────────────────────────────── 6. Buttons ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: var(--on-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
                box-shadow 0.25s ease, transform 0.25s ease;
}
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn i.fa { font-size: 0.9em; }
.btn-sm { padding: 12px 24px; font-size: 13px; }
.btn-lg { padding: 20px 48px; font-size: 16px; }
.btn-block { display: flex; width: 100%; text-align: center; }

.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 25px rgba(51, 20, 74, 0.2); }
.btn-primary:hover { background: #421a5d; transform: translateY(-1px); box-shadow: 0 12px 30px rgba(51, 20, 74, 0.28); }
.btn-secondary { background: var(--secondary); color: var(--on-secondary); }
.btn-secondary:hover { background: #2a4e74; color: var(--on-secondary); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: rgba(51, 20, 74, 0.06); color: var(--primary); }
.btn-outline-light { background: transparent; color: var(--warm-white); border-color: rgba(249, 248, 246, 0.6); }
.btn-outline-light:hover { background: rgba(249, 248, 246, 0.12); color: var(--warm-white); }
.btn-light { background: var(--warm-white); color: var(--primary); }
.btn-light:hover { background: #efece9; color: var(--primary); }
.btn:disabled { background: var(--outline); cursor: not-allowed; }

/* Legacy aliases — used by existing pages & plugins */
.btn-premium { background: var(--primary); color: var(--on-primary); padding: 14px 32px; border-radius: var(--radius-sm); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; box-shadow: 0 10px 25px rgba(51, 20, 74, 0.2); }
.btn-premium:hover { background: #421a5d; transform: translateY(-1px); color: var(--on-primary); }
.btn-premium-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); padding: 14px 32px; border-radius: var(--radius-sm); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.btn-premium-outline:hover { background: rgba(51, 20, 74, 0.06); color: var(--primary); }
.btn-hero, .btn-hero-secondary { border-radius: 20px; }

/* ─────────────────────────────── 7. Hero (frontend-style) ─────────────────────────────── */
.hero {
    position: relative;
    min-height: 60vh;
    border-radius: 0;
}
.hero .hero-content h1 { font-family: var(--font-heading); font-weight: 600; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(135deg, rgba(51, 20, 74, 0.85) 0%, rgba(0, 43, 94, 0.85) 100%);
}
.hero-overlay-side {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to right, rgba(249, 248, 246, 0.8) 0%, rgba(249, 248, 246, 0) 60%);
}
.hero-content { position: relative; z-index: 2; width: 100%; max-width: var(--container-max); margin: 0 auto; }
.hero-eyebrow {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 16px;
}
.hero-content--center { text-align: center; }
.hero-content--center h1 { margin: 0; }

@media (max-width: 767px) {
    .hero-content { flex: none; }
    .hero .hero-actions {
        flex-wrap: nowrap;
        justify-content: center;
    }
    .hero .hero-actions .btn-hero,
    .hero .hero-actions .btn-hero-secondary {
        width: auto;
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }
}

/* ─────────────────────────────── 8. Section Headers ─────────────────────────────── */
.section-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 64px;
}
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 40px);
    color: var(--primary);
    margin: 0 0 24px;
    text-align: center;
}
.section-subtitle {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 20px;
    line-height: 32px;
    color: var(--on-surface-variant);
}
.section-divider {
    width: 96px;
    height: 4px;
    background: rgba(51, 20, 74, 0.2);
    margin: 32px auto 0;
    border-radius: 2px;
}
.section-actions {
    text-align: center;
    margin-top: 48px;
}

/* Utility */
.text-center { text-align: center; }

/* Mission/values lists */
.check-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}
.check-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--on-surface-variant);
}
.check-list i { color: var(--secondary); margin-top: 5px; flex-shrink: 0; }
.values-statement {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

/* Radio groups (contact form) */
.radio-group {
    display: flex;
    gap: 32px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}
.radio-label input { width: auto; }

/* Checkboxes & radios must not inherit the "boxed" input styling */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    accent-color: var(--secondary);
}

/* Narrow contact form wrapper */
.contact-form-narrow { max-width: 800px; margin: 0 auto; }

/* Team group photo */
.team-photo { text-align: center; }
.team-group-photo {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--surface-container-lowest);
    border: 1px solid var(--surface-variant);
    border-radius: var(--radius-lg);
    padding: 24px 24px 20px;
    box-shadow: var(--shadow-card);
}
.team-group-photo img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius);
}
.team-group-photo figcaption {
    margin: 20px 0 0;
    font-size: 18px;
    color: var(--on-surface-variant);
    line-height: 1.6;
}

/* ─────────────────────────────── 9. Services ─────────────────────────────── */
.services-section {
    padding: var(--stack-lg) var(--margin-mobile);
    background: var(--surface-container-low);
}
#services { scroll-margin-top: 100px; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 40px;
    max-width: var(--container-max);
    margin: 0 auto;
}
.service-card {
    background: var(--warm-white);
    border: 1px solid var(--surface-variant);
    border-radius: var(--radius-sm);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.service-card:hover { box-shadow: var(--shadow-ambient); transform: translateY(-2px); }
.service-icon { color: rgba(53, 97, 142, 0.85); margin: 0 0 24px; line-height: 1; }
.service-icon .material-symbols-outlined { font-size: 48px; }
.service-icon i.fa { font-size: 40px; }
.service-icon img { width: 50px; height: 50px; object-fit: contain; filter: hue-rotate(-50deg) brightness(1.5) saturate(0.6); }
.service-card h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 32px;
    color: var(--primary);
    margin: 0 0 16px;
}
.service-card p { font-size: 16px; line-height: 26px; color: var(--on-surface-variant); margin: 0; }

/* Horizontal service card (used on the services page) */
.service-card--row {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 24px;
}
.service-card--row .service-icon { margin: 4px 0 0; flex-shrink: 0; }
.service-card--row h3 { margin-bottom: 8px; }

/* Centered final card — sits in the 2nd column of the last row (3-col grid) */
@media (min-width: 1100px) {
    .service-card--middle { grid-column: 2; }
}

/* ─────────────────────────────── 10. Technology Banner ─────────────────────────────── */
.tech-banner {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    overflow: hidden;
}
.tech-banner .hero-media img { opacity: 0.5; mix-blend-mode: multiply; }
.tech-banner-content {
    position: relative;
    z-index: 2;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 80px var(--margin-mobile);
    text-align: center;
    color: var(--warm-white);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tech-banner .tech-icon { color: rgba(249, 248, 246, 0.85); margin: 0 0 24px; line-height: 1; }
.tech-banner .tech-icon .material-symbols-outlined { font-size: 48px; }
.tech-banner h2 {
    font-family: var(--font-heading);
    font-size: clamp(40px, 7vw, 64px);
    color: var(--warm-white);
    margin: 0 0 24px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.tech-banner p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 20px;
    line-height: 32px;
    color: rgba(249, 248, 246, 0.9);
    max-width: 720px;
    margin: 0;
}
.tech-divider { width: 64px; height: 1px; background: rgba(249, 248, 246, 0.5); margin: 40px auto 0; }

/* ─────────────────────────────── 11. About ─────────────────────────────── */
.about-section { padding: var(--stack-lg) var(--margin-mobile); background: var(--warm-white); }
.about-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.about-copy h2 { font-size: clamp(32px, 5vw, 40px); color: var(--primary); margin: 0 0 24px; }
.about-copy p { font-size: 17px; line-height: 30px; color: var(--on-surface-variant); margin: 0 0 24px; }
.about-media img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-ambient); }
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-media { order: -1; }
}

/* ─────────────────────────────── 12. CTA Band ─────────────────────────────── */
.cta-band { background: var(--primary); color: var(--warm-white); padding: var(--stack-lg) var(--margin-mobile); }
.cta-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 40px;
}
.cta-col h3 { color: var(--warm-white); font-size: 24px; line-height: 32px; margin: 0 0 16px; }
.cta-col p { color: rgba(249, 248, 246, 0.78); line-height: 1.6; margin: 0 0 24px; }
.cta-list { list-style: none; margin: 0; padding: 0; }
.cta-list li { margin-bottom: 12px; }
.cta-list a {
    color: var(--warm-white);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.cta-list a:hover { text-decoration: underline; color: var(--warm-white); }

/* ─────────────────────────────── 13. Page Header (subpages) ─────────────────────────────── */
.page-header {
    background: var(--primary);
    color: var(--warm-white);
    padding: 96px var(--margin-mobile) 72px;
    text-align: center;
    position: relative;
}
.page-header--media { background-size: cover; background-position: center; }
.page-header--media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(51, 20, 74, 0.68);
    z-index: 1;
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(40px, 6vw, 64px);
    color: var(--warm-white);
    margin: 0 0 8px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}
.page-header p { font-size: 20px; opacity: 0.92; margin: 0; }

.page-header--contact { background-image: url('../assets/img/web-16.jpg'); }
.page-header--appointment { background-image: url('../assets/img/web-11.jpg'); }
.page-header--lenses { background-image: url('../assets/img/web-12.jpg'); }

/* ─────────────────────────────── 14. Content Pages ─────────────────────────────── */
.page-section { padding: var(--stack-lg) var(--margin-mobile); }
.page-section h1 { margin-bottom: 24px; color: var(--primary); }
.page-section-back { margin-top: 32px; }
.page-content { padding: 64px var(--margin-mobile); max-width: 1000px; margin: 0 auto; width: 100%; }
.page-content--wide { max-width: 1280px; }
.error-icon { font-size: 64px; color: var(--error); display: block; margin-bottom: 16px; }
.error-code { font-size: 64px; margin-bottom: 8px; }

.rich-content,
.legal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px;
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    line-height: 1.8;
    color: var(--on-surface);
}
.rich-content h2, .legal-content h2 { font-size: 28px; margin: 32px 0 16px; color: var(--primary); }
.rich-content h3, .legal-content h3 { font-size: 22px; margin: 24px 0 12px; }
.rich-content p, .legal-content p { margin-bottom: 20px; font-size: 16px; }
.rich-content ul, .legal-content ul,
.rich-content ol, .legal-content ol { margin: 0 0 20px 24px; }
.rich-content li, .legal-content li { margin-bottom: 8px; }
.rich-content img, .legal-content img { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin: 24px 0; }

/* PDF embed pages */
.pdf-frame { padding: 64px 20px 80px; background: var(--surface-container-low); }
.pdf-frame .container { max-width: 1000px; text-align: center; }
.pdf-frame embed { border-radius: var(--radius-lg); box-shadow: var(--shadow-ambient); background: #fff; }
.pdf-frame p { margin-top: 16px; }

/* ─────────────────────────────── 15. Forms ─────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--on-surface); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-sm);
    background: var(--surface-container-lowest);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--on-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(53, 97, 142, 0.15);
}
.form-group textarea { resize: vertical; }
.form-group input[type="file"] { padding: 10px; background: var(--surface-container-low); cursor: pointer; }
.required { color: var(--error); }
.hint { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 180px; }
.form-group-wide { flex: 2; min-width: 250px; }
.form-row-align { align-items: center; }
.form-sep { margin: 32px 0; border: 0; border-top: 1px solid var(--surface-variant); }
.form-title {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--primary);
    margin: 0 0 16px;
}
.form-note { font-size: 14px; line-height: 1.7; color: var(--on-surface-variant); }

/* Password toggle (frontend) */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--on-surface-variant);
    cursor: pointer;
    padding: 8px;
    font-size: 15px;
}
.pwd-toggle:hover { color: var(--primary); }

/* Login / auth card */
.login-form {
    max-width: 440px;
    margin: 64px auto;
    padding: 40px;
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ambient);
}
.login-form h2 { text-align: center; margin-bottom: 8px; }
.login-form .hint { text-align: center; margin-bottom: 24px; }
.login-form .btn { width: 100%; }
.form-aux { text-align: center; margin-top: 16px; font-size: 14px; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-aux a { font-size: 14px; }
.form-aux-sep { color: var(--outline-variant); }
.card-intro { text-align: center; color: var(--text-muted); margin-bottom: 24px; }
.card-foot { text-align: center; margin-top: 24px; color: var(--text-muted); }
.otp-input { letter-spacing: 0.4em; font-size: 1.5rem; text-align: center; }

/* Generic frontend content wrapper (register + ecommerce pages) */
.frontend-content { padding: 48px 20px; max-width: 900px; margin: 0 auto; width: 100%; }
.frontend-content .card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--surface-variant);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
}
.frontend-content .card h1 { text-align: center; }
.frontend-content .card > p { text-align: center; color: var(--text-muted); margin-bottom: 24px; }

/* ─────────────────────────────── 16. Contact ─────────────────────────────── */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
.contact-form-container {
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
}
.contact-form-container .form-row { display: flex; gap: 16px; }
.contact-form-container .form-row > div { flex: 1; min-width: 200px; }
.contact-info {
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--surface-variant);
}
.contact-info h3 { margin-bottom: 24px; color: var(--primary); }
.contact-detail { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.contact-detail i { font-size: 20px; color: var(--secondary); min-width: 24px; margin-top: 3px; }
.contact-detail strong { display: block; margin-bottom: 4px; }
.contact-detail p { font-size: 15px; color: var(--on-surface-variant); line-height: 1.6; margin: 0; }
.contact-detail a { font-size: 15px; }
.contact-social { display: flex; gap: 12px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--surface-variant); }
.contact-social a {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(53, 97, 142, 0.1); color: var(--secondary);
    text-decoration: none; transition: background 0.2s, color 0.2s;
}
.contact-social a:hover { background: var(--primary); color: var(--warm-white); }
.contact-success { text-align: center; padding: 32px 0; }
.contact-success i { font-size: 48px; color: var(--success); margin-bottom: 16px; }
.contact-success p { font-size: 18px; margin-bottom: 24px; }
@media (max-width: 767px) { .contact-layout { grid-template-columns: 1fr; } }

/* Practice cards (contact page) */
.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 1100px; margin: 0 auto; }
.practice-card h3 { font-size: 22px; text-align: center; margin-bottom: 24px; }
.practice-detail { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.practice-detail i { color: var(--secondary); font-size: 20px; width: 24px; flex-shrink: 0; }
.practice-detail a, .practice-detail span { font-size: 16px; }
.practice-map { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); margin-top: 8px; }
.practice-map iframe { border: 0; display: block; }
@media (max-width: 767px) { .practice-grid { grid-template-columns: 1fr; } }

/* ─────────────────────────────── 17. Alerts ─────────────────────────────── */
.alert { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 24px; font-weight: 500; }
.alert-success { background: #d7f2dd; color: #14532d; border: 1px solid #b6e3c4; }
.alert-error { background: var(--error-container); color: var(--on-error-container); border: 1px solid #ffc7c1; }
.alert-info { background: #e8f4fd; color: #004085; border: 1px solid #b8daff; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; }

/* ─────────────────────────────── 18. Team & Brands ─────────────────────────────── */
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
.team-member {
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    text-align: left;
}
.team-member:nth-child(even) { flex-direction: row-reverse; }
.team-member img {
    border-radius: 50%;
    width: 180px; height: 180px;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--primary);
}
.team-member .team-member-body { flex: 1; min-width: 0; }
.team-member h3 { font-size: 24px; margin: 0 0 16px; }
.team-member p { line-height: 1.7; font-size: 15px; color: var(--on-surface-variant); margin: 0 0 16px; }
.team-member p:last-child { margin-bottom: 0; }
@media (max-width: 767px) {
    .team-member,
    .team-member:nth-child(even) { flex-direction: column; align-items: center; text-align: center; padding: 32px 24px; }
    .team-member img { margin: 0 auto 16px; }
    .team-member .team-member-body { text-align: center; }
}
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}
.brand-item {
    background: var(--surface-container-lowest);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex; align-items: center; justify-content: center;
    height: 100%;
}
.brand-item:hover { box-shadow: var(--shadow-ambient); transform: translateY(-2px); }
.brand-item img { max-width: 100%; max-height: 120px; object-fit: contain; }

/* Brands carousel (home) */
.brands-section { padding: var(--stack-lg) var(--margin-mobile); background: var(--surface-container-low); }
.brands-carousel { position: relative; display: flex; align-items: center; gap: 16px; }
.brands-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 4px;
    flex: 1;
}
.brands-track::-webkit-scrollbar { display: none; }
.brand-slide {
    flex: 0 0 200px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--surface-variant);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    transition: box-shadow 0.3s, transform 0.3s;
}
.brand-slide:hover { box-shadow: var(--shadow-ambient); transform: translateY(-2px); }
.brand-slide img { max-width: 100%; max-height: 80px; object-fit: contain; }
.carousel-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--surface-variant);
    background: var(--surface-container-lowest);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    box-shadow: var(--shadow-card);
}
.carousel-btn:hover { background: var(--primary); color: var(--warm-white); }
.carousel-btn.is-hidden { opacity: 0; pointer-events: none; }
@media (max-width: 767px) {
    .carousel-btn { display: none; }
}

/* ─────────────────────────────── 19. Feature & Stats ─────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-card { text-align: center; padding: 32px 24px; border-radius: var(--radius-lg); border: 1px solid var(--surface-variant); background: var(--surface-container-lowest); transition: transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-ambient); }
.feature-icon { width: 60px; height: 60px; margin: 0 auto 16px; background: var(--lavender-mist); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--secondary); }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { font-size: 15px; color: var(--on-surface-variant); line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.stat-card { text-align: center; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--surface-variant); background: var(--surface-container-lowest); transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-value { font-size: 32px; color: var(--primary); margin-bottom: 8px; }
.stat-label { font-size: 12px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }

/* ─────────────────────────────── 20. Footer ─────────────────────────────── */
.site-footer { background: var(--warm-white); color: var(--on-surface-variant); border-top: 1px solid var(--surface-variant); }
.footer-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--stack-lg) var(--margin-desktop);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--gutter);
}
.footer-brand h3 { font-family: var(--font-heading); font-size: 32px; color: var(--primary); margin: 0 0 16px; text-align: left; }
.footer-brand { text-align: left; }
.footer-brand p { margin: 0 0 24px; max-width: 440px; line-height: 1.7; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(53, 97, 142, 0.1); color: var(--secondary);
    text-decoration: none; transition: background 0.2s, color 0.2s;
}
.footer-social a:hover { background: var(--primary); color: var(--warm-white); }
.footer-col h4 {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(51, 20, 74, 0.7);
    margin: 0 0 24px;
    text-align: left;
}
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: inherit; text-decoration: none; transition: color 0.2s; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
.footer-links a:hover { color: var(--primary); }
.footer-links a i.fa { font-size: 0.85em; color: var(--secondary); }
.footer-bottom {
    border-top: 1px solid var(--surface-variant);
    padding: 32px 20px;
    text-align: center;
    font-size: 14px;
}
.footer-bottom p { margin: 0; opacity: 0.7; }
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a:hover { color: var(--primary); }
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr; text-align: left; padding: var(--stack-lg) var(--margin-mobile); }
    .footer-brand p { margin: 0 0 24px; }
    .footer-social, .footer-links { justify-content: flex-start; align-items: flex-start; }
}

/* ─────────────────────────────── 21. Animations ─────────────────────────────── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
/* Centered hero text stays put (no vertical shift) — only fades in */
.hero-content--center.fade-in,
.hero-content--center.fade-in.visible { transform: none; }
@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}
