/* ============================================================
   MAPONE – Design Tokens & Global Styles
   Based on the original Tailwind v4 + shadcn/ui design system
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
    --background: oklch(0.98 0 0);
    --foreground: oklch(0.12 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.12 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.12 0 0);
    --primary: oklch(0.15 0 0);
    --primary-foreground: oklch(0.98 0 0);
    --secondary: oklch(0.95 0 0);
    --secondary-foreground: oklch(0.15 0 0);
    --muted: oklch(0.95 0 0);
    --muted-foreground: oklch(0.45 0 0);
    --accent: oklch(0.72 0.15 180);
    --accent-foreground: oklch(0.15 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(0.577 0.245 27.325);
    --border: oklch(0.9 0 0);
    --input: oklch(0.9 0 0);
    --ring: oklch(0.72 0.15 180);
    --radius: 0.75rem;
}

.dark {
    --background: oklch(0.1 0 0);
    --foreground: oklch(0.95 0 0);
    --card: oklch(0.14 0 0);
    --card-foreground: oklch(0.95 0 0);
    --popover: oklch(0.14 0 0);
    --popover-foreground: oklch(0.95 0 0);
    --primary: oklch(0.95 0 0);
    --primary-foreground: oklch(0.1 0 0);
    --secondary: oklch(0.2 0 0);
    --secondary-foreground: oklch(0.95 0 0);
    --muted: oklch(0.2 0 0);
    --muted-foreground: oklch(0.6 0 0);
    --accent: oklch(0.78 0.15 195);
    --accent-foreground: oklch(0.1 0 0);
    --destructive: oklch(0.396 0.141 25.723);
    --destructive-foreground: oklch(0.637 0.237 25.331);
    --border: oklch(0.22 0 0);
    --input: oklch(0.22 0 0);
    --ring: oklch(0.78 0.15 195);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--border);
    outline-color: color-mix(in srgb, var(--ring) 50%, transparent);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-snap-type: y proximity;
}

body {
    margin: 0;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ---------- Utility Classes ---------- */

/* Layout */
.container {
    max-width: 72rem; /* max-w-6xl */
    margin-left: auto;
    margin-right: auto;
}

.container-padded {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-padded {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Text */
.text-accent {
    color: var(--accent);
}
.text-muted {
    color: var(--muted-foreground);
}
.text-foreground {
    color: var(--foreground);
}

/* Full-width container that overflows on mobile for scrollable strips */
.overflow-strip {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .overflow-strip {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: visible;
    }
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Button Styles ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 150ms ease;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

/* Sizes */
.btn-default {
    height: 2.25rem;
    padding: 0 1rem;
}
.btn-sm {
    height: 2rem;
    padding: 0 0.75rem;
    gap: 0.375rem;
    border-radius: 0.375rem;
}
.btn-lg {
    height: 2.5rem;
    padding: 0 1.5rem;
    border-radius: 0.375rem;
}
.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

/* Variants */
.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}
.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    background: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-outline:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.btn-ghost {
    background: transparent;
    color: var(--foreground);
}
.btn-ghost:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.btn-rounded {
    border-radius: 9999px;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-default {
    background: var(--primary);
    color: var(--primary-foreground);
}

.badge-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.badge-accent {
    background: var(--accent);
    color: var(--accent-foreground);
}

/* ---------- Dialog / Modal ---------- */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.dialog-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 51;
    width: calc(100% - 2rem);
    max-width: 28rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

@media (min-width: 640px) {
    .dialog-content {
        max-width: 32rem;
    }
}

.dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    background: none;
    border: none;
    color: var(--foreground);
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 150ms;
}
.dialog-close:hover {
    opacity: 1;
}
.dialog-close svg {
    width: 1rem;
    height: 1rem;
}

/* ---------- Hidden utility ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hidden-desktop {
    display: block;
}
.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-desktop {
        display: none;
    }
    .hidden-mobile {
        display: block;
    }
}

/* ============================================================
   COMPONENT STYLES
   ============================================================ */

/* ---------- Header ---------- */
.map-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--background) 80%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.map-header .header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .map-header .header-inner {
        padding: 0 1.5rem;
    }
}

.map-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.map-header .logo-img {
    height: 2.5rem;
    width: auto;
}

@media (min-width: 640px) {
    .map-header .logo-img {
        height: 2.75rem;
    }
}

.map-header .nav-links {
    display: none;
}

@media (min-width: 768px) {
    .map-header .nav-links {
        display: flex;
        align-items: center;
        gap: 2rem;
    }
}

.map-header .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 150ms;
}
.map-header .nav-link:hover {
    color: var(--foreground);
}

.map-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-header .mobile-menu-btn {
    display: flex;
}

@media (min-width: 768px) {
    .map-header .mobile-menu-btn {
        display: none;
    }
}

.map-header .cta-btn {
    display: none;
}

@media (min-width: 640px) {
    .map-header .cta-btn {
        display: inline-flex;
    }
}

/* Mobile menu */
.map-header .mobile-menu {
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    display: none;
}
.map-header .mobile-menu.open {
    display: block;
}

@media (min-width: 768px) {
    .map-header .mobile-menu {
        display: none !important;
    }
}

.map-header .mobile-menu .mobile-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-header .mobile-menu .mobile-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 150ms;
}
.map-header .mobile-menu .mobile-link:hover {
    color: var(--foreground);
}

.map-header .mobile-cta {
    width: 100%;
    margin-top: 0.5rem;
}

/* Theme toggle button */
.theme-toggle {
    border-radius: 9999px;
}

/* ---------- Hero ---------- */
.map-hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 4rem;
}

.map-hero .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.map-hero .hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.dark .map-hero .hero-bg img {
    opacity: 0.3;
}

.map-hero .hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        var(--background),
        color-mix(in srgb, var(--background) 90%, transparent),
        var(--background)
    );
}

.map-hero .hero-content {
    position: relative;
    z-index: 10;
    max-width: 48rem;
    margin: 0 auto;
    padding: 4rem 1rem;
    text-align: center;
}

@media (min-width: 640px) {
    .map-hero .hero-content {
        padding: 4rem 1.5rem;
    }
}

.map-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    margin-bottom: 1.5rem;
}

.map-hero .hero-badge svg {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--accent);
}

.map-hero .hero-badge span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-hero .hero-headline {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 1rem;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

@media (min-width: 640px) {
    .map-hero .hero-headline {
        font-size: 3rem;
    }
}
@media (min-width: 768px) {
    .map-hero .hero-headline {
        font-size: 3.75rem;
    }
}
@media (min-width: 1024px) {
    .map-hero .hero-headline {
        font-size: 4.5rem;
    }
}

.map-hero .hero-headline .accent {
    color: var(--accent);
}

.map-hero .hero-subheadline {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 32rem;
    margin: 0 auto 2.5rem;
}

@media (min-width: 640px) {
    .map-hero .hero-subheadline {
        font-size: 1.25rem;
    }
}

.map-hero .hero-ctas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
    .map-hero .hero-ctas {
        flex-direction: row;
    }
}

.map-hero .hero-ctas .btn {
    width: 100%;
    font-size: 1.25rem;
    padding: 0 3rem;
    height: 3.75rem;
    border-radius: 9999px;
}

@media (min-width: 640px) {
    .map-hero .hero-ctas .btn {
        width: auto;
    }
}

/* Steps strip */
.map-hero .steps-strip {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .map-hero .steps-strip {
        justify-content: center;
        overflow: visible;
    }
}

.map-hero .step-item {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.map-hero .step-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .map-hero .step-circle {
        gap: 0.75rem;
    }
}

.map-hero .step-circle .step-icon-wrap {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .map-hero .step-circle .step-icon-wrap {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.map-hero .step-circle .step-icon-wrap svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent);
}

@media (min-width: 640px) {
    .map-hero .step-circle .step-icon-wrap svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}

.map-hero .step-circle span {
    font-size: 0.6875rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    font-weight: 500;
}

@media (min-width: 640px) {
    .map-hero .step-circle span {
        font-size: 0.875rem;
    }
}

.map-hero .step-connector {
    width: 1.5rem;
    height: 1px;
    background: var(--border);
    margin: 0 0.25rem 1.5rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .map-hero .step-connector {
        width: 4rem;
    }
}

/* ---------- Product Customizer ---------- */
.map-customizer {
    min-height: 80vh;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    background: var(--background);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (min-width: 640px) {
    .map-customizer {
        min-height: 100vh;
        padding: 3rem 0;
    }
}

.map-customizer .customizer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

@media (min-width: 640px) {
    .map-customizer .customizer-inner {
        padding: 0 1.5rem;
    }
}

.map-customizer .customizer-header {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.customizer-header {
    margin-top: 1rem;
}

.map-customizer .customizer-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 0.25rem;
}

@media (min-width: 640px) {
    .map-customizer .customizer-title {
        font-size: 1.875rem;
    }
}

.map-customizer .customizer-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Desktop header row */
.map-customizer .desktop-header-row {
    display: none;
}

@media (min-width: 878px) {
    .map-customizer .desktop-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
}

.map-customizer .product-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.map-customizer .product-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms;
    background: var(--card);
}

.map-customizer .product-pill:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--foreground) 50%, transparent);
}

.map-customizer .product-pill.active {
    background: var(--foreground);
    color: var(--background);
    border-color: var(--foreground);
}

.map-customizer .product-pill:disabled {
    background: var(--muted);
    border-color: var(--border);
    opacity: 1;
    color: var(--muted-foreground);
    cursor: not-allowed;
}

.map-customizer .product-pill .pill-label {
    font-weight: 500;
}

/* Mobile header row */
.map-customizer .mobile-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

@media (min-width: 878px) {
    .map-customizer .mobile-header-row {
        display: none;
    }
}

.map-customizer .mobile-product-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms;
    flex-shrink: 0;
    color: var(--foreground);
}

.map-customizer .mobile-product-trigger:hover {
    border-color: color-mix(in srgb, var(--foreground) 50%, transparent);
}

.map-customizer .mobile-product-trigger .trigger-label {
    font-weight: 500;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile card (replaces iframe) */
.map-customizer .mobile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

@media (min-width: 640px) {
    .map-customizer .mobile-card {
        display: none;
    }
}

.map-customizer .mobile-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.map-customizer .mobile-card .card-body img {
    border-radius: 0.75rem;
    object-fit: cover;
    max-width: 200px;
    height: auto;
}

.map-customizer .mobile-card .card-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.map-customizer .mobile-card .card-body p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
    max-width: 280px;
}

.map-customizer .mobile-card .open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 2rem;
    height: 3rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    font-family: inherit;
    cursor: pointer;
}
.map-customizer .mobile-card .open-btn:hover {
    opacity: 0.9;
}

/* Desktop iframe card */
.map-customizer .iframe-card {
    display: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    flex-direction: column;
}

@media (min-width: 640px) {
    .map-customizer .iframe-card {
        display: flex;
    }
}

.map-customizer .iframe-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--muted) 30%, transparent);
    flex-shrink: 0;
}

.map-customizer .iframe-topbar .topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.map-customizer .iframe-topbar .topbar-thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--muted);
}

.map-customizer .iframe-topbar .topbar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-customizer .iframe-topbar h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.map-customizer .iframe-topbar p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin: 0;
}

.map-customizer .iframe-topbar .fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    height: 2rem;
    font-size: 0.875rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms;
    white-space: nowrap;
}
.map-customizer .iframe-topbar .fullscreen-btn:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.map-customizer .iframe-container {
    height: min(700px, 75dvh);
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.map-customizer .iframe-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0 0 0.75rem 0.75rem;
}

.map-customizer .iframe-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--muted) 50%, transparent);
    z-index: 10;
    border-radius: 0 0 0.75rem 0.75rem;
}

.map-customizer .iframe-loader .loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.map-customizer .spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid color-mix(in srgb, var(--foreground) 20%, transparent);
    border-top-color: var(--foreground);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.map-customizer .iframe-loader .loader-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Mobile product modal */
.map-customizer .product-modal {
    position: fixed;
    inset: 0;
    z-index: 51;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-customizer .product-modal .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.5);
}

.map-customizer .product-modal .modal-sheet {
    position: relative;
    z-index: 51;
    width: calc(100% - 2rem);
    max-width: 28rem;
    margin: 0 auto;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.25);
    animation: modalScaleIn 200ms ease-out;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.map-customizer .modal-sheet h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.map-customizer .modal-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all 150ms;
    text-align: left;
    margin-bottom: 0.25rem;
}

.map-customizer .modal-option:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--foreground) 30%, transparent);
}

.map-customizer .modal-option.selected {
    border-color: var(--foreground);
    background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

.map-customizer .modal-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.map-customizer .modal-option .modal-option-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.map-customizer .modal-radio {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid
        color-mix(in srgb, var(--muted-foreground) 30%, transparent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-customizer .modal-option.selected .modal-radio {
    background: var(--accent);
    border-color: var(--accent);
}

.map-customizer .modal-radio svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ---------- Gallery ---------- */
.map-gallery {
    padding: 3rem 0;
    background: color-mix(in srgb, var(--muted) 30%, transparent);
}

@media (min-width: 640px) {
    .map-gallery {
        padding: 4rem 0;
    }
}

.map-gallery .gallery-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .map-gallery .gallery-inner {
        padding: 0 1.5rem;
    }
}

.map-gallery .gallery-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .map-gallery .gallery-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.map-gallery .gallery-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}

@media (min-width: 640px) {
    .map-gallery .gallery-title {
        font-size: 1.875rem;
    }
}

.map-gallery .gallery-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0.25rem 0 0;
}

.map-gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .map-gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.map-gallery .gallery-item {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 150ms;
    padding: 0;
    font-family: inherit;
}

.map-gallery .gallery-item:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.map-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms;
}

.map-gallery .gallery-item:hover img {
    transform: scale(1.05);
}

.map-gallery .gallery-item .item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8),
        transparent,
        transparent
    );
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 150ms;
}

.map-gallery .gallery-item:hover .item-overlay {
    opacity: 1;
}

.map-gallery .gallery-item .overlay-content {
    padding: 1rem;
    width: 100%;
}

.map-gallery .gallery-item .overlay-prompt {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.map-gallery .gallery-item .overlay-author {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 150ms;
    display: flex;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.lightbox-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 150ms;
    z-index: 1;
    display: flex;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}
.lightbox-prev {
    left: 0.5rem;
}
.lightbox-next {
    right: 0.5rem;
}
.lightbox-prev svg,
.lightbox-next svg {
    width: 1.75rem;
    height: 1.75rem;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    margin: 0 0 0.25rem;
    letter-spacing: 0.05em;
}

.lightbox-body {
    max-width: 56rem;
    width: 100%;
}

.lightbox-img-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 0.75rem;
    overflow: hidden;
}

.lightbox-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-info {
    margin-top: 1rem;
    text-align: center;
}

.lightbox-info .lightbox-prompt {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
}

.lightbox-info .lightbox-author {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

/* ---------- Footer ---------- */
.map-footer {
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--muted) 30%, transparent);
}

.map-footer .footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 3rem 1rem;
}

@media (min-width: 640px) {
    .map-footer .footer-inner {
        padding: 3rem 1.5rem;
    }
}

.map-footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .map-footer .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.map-footer .footer-brand {
    grid-column: span 2;
}

@media (min-width: 768px) {
    .map-footer .footer-brand {
        grid-column: span 1;
    }
}

.map-footer .footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.map-footer .footer-logo img {
    height: 2.5rem;
    width: auto;
}

.map-footer .footer-tagline {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin: 0;
}

.map-footer .footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--foreground);
}

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

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

.map-footer .footer-links a {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    transition: color 150ms;
}
.map-footer .footer-links a:hover {
    color: var(--foreground);
}

.map-footer .footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 640px) {
    .map-footer .footer-bottom {
        flex-direction: row;
    }
}

.map-footer .footer-bottom .copyright {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

.map-footer .footer-bottom .made-with {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ---------- Legal Pages ---------- */
.legal-page {
    min-height: 100vh;
    background: var(--background);
}

.legal-page .legal-main {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

.legal-page .legal-body {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .legal-page .legal-body {
        padding: 0 1.5rem;
    }
}

.legal-page .legal-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 2rem;
}

@media (min-width: 640px) {
    .legal-page .legal-title {
        font-size: 2.25rem;
    }
}

.legal-page .legal-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--muted-foreground);
}

.legal-page .legal-sections h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0 0 0.5rem;
}

.legal-page .legal-sections p {
    margin: 0;
    line-height: 1.7;
}

.legal-page .legal-sections ul,
.legal-page .legal-sections ol {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.legal-page .legal-sections li {
    margin-bottom: 0.25rem;
}

.legal-page .legal-footer-note {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    padding-top: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ---------- Customizer-only page (fullscreen via ?customizer=) ---------- */
.customizer-page,
.customizer-page body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #fff;
}

.customizer-only-frame {
    display: block;
    width: 100%;
    height: 100dvh;
    border: 0;
    background: #fff;
    color-scheme: dark;
}
