:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-strong: #eef3fb;
    --border: #d8e0ea;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #111827;
    --primary-soft: #1f2937;
    --accent: #335dff;
    --accent-soft: rgba(51, 93, 255, 0.12);
    --success: #0f8a5f;
    --warning: #b86b00;
    --danger: #b42318;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 14px 36px rgba(15, 23, 42, 0.05);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    background:
        linear-gradient(180deg, #f6f8fc 0%, #eef3fb 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family:
        "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI",
        system-ui, sans-serif;
    line-height: 1.5;
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(238,243,251,0.96));
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
}

.app-page-content {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
    align-items: stretch;
}

.dashboard-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: none;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease;
}

.dashboard-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.dashboard-card > * {
    min-width: 0;
}

.dashboard-card [data-card-clamp] {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.mini-stat {
    gap: 12px;
}

.mini-stat .metric-value {
    font-size: 1.6rem;
}

.metric-value {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.helper {
    color: var(--muted);
    font-size: 0.88rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 120ms ease,
        box-shadow 120ms ease,
        background 120ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(145deg, #0f172a, #1e293b);
    color: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
}

.button.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: rgba(215, 221, 229, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tiny {
    font-size: 0.86rem;
}

.muted {
    color: var(--muted);
}

.lego-page {
    display: grid;
    gap: 12px;
    padding-top: 18px;
}

.lego-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
    gap: 18px;
    align-items: center;
    min-height: 240px;
    background: linear-gradient(180deg, rgba(255,255,255,0.74), rgba(245,248,252,0.9));
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: none;
    overflow: hidden;
}

.lego-series-slider-section {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    padding: 12px 16px;
    gap: 8px;
}

.lego-series-slider-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lego-series-slider-heading .eyebrow {
    margin: 0;
}

.lego-series-rank-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lego-series-rank-button {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 50%;
    background: rgba(226, 232, 240, 0.58);
    font-size: 1.5rem;
    opacity: 0.5;
    filter: grayscale(0.75);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.lego-series-rank-button:not([aria-pressed="true"]):hover {
    transform: translateY(-2px);
    opacity: 0.8;
    filter: grayscale(0.25);
}

.lego-series-rank-button[aria-pressed="true"] {
    background: #fff8df;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
    opacity: 1;
    filter: none;
}

.lego-series-rank-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lego-series-slider-shell {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 0;
}

.lego-series-slider-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(51, 93, 255, 0.06), rgba(15, 23, 42, 0.01));
    border: 1px solid rgba(148, 163, 184, 0.08);
    min-height: 230px;
}

.lego-series-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.45s ease;
}

.lego-series-slide {
    display: grid;
    grid-template-columns: minmax(340px, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    flex: 0 0 100%;
    width: 100%;
    min-height: 230px;
    padding: 10px;
    box-sizing: border-box;
}

.lego-series-slide-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    height: 260px;
    min-height: 260px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.lego-series-slide-visual.city {
    background: linear-gradient(135deg, #335dff, #111827);
}

.lego-series-slide-visual.space {
    background: linear-gradient(135deg, #0ea5e9, #111827);
}

.lego-series-slide-visual.hero {
    background: linear-gradient(135deg, #f59e0b, #111827);
}

.lego-series-image-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.lego-series-image-badge {
    position: absolute;
    z-index: 1;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.lego-series-image-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 22px;
    font-size: 7.5rem;
    line-height: 1;
    object-fit: cover;
}

.lego-series-slide-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
}

.lego-series-slide-copy h3 {
    margin: 0;
    font-size: clamp(1.7rem, 2.2vw, 2.5rem);
    letter-spacing: -0.05em;
    color: var(--text);
}

.lego-series-slide-copy p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.35;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lego-series-product-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.25;
}

.lego-series-description {
    white-space: pre-wrap;
}

.lego-series-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 0;
}

.lego-series-product-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    min-height: 110px;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(240,244,250,0.94));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    font-size: 2.6rem;
    color: inherit;
    text-decoration: none;
}

.lego-series-product-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lego-series-product-name {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lego-series-product-placeholder,
.lego-series-product-empty {
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.lego-series-product-empty {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}

.lego-series-product-item.product-a {
    background: linear-gradient(180deg, rgba(250, 250, 255, 0.9), rgba(217, 229, 255, 0.8));
}

.lego-series-product-item.product-b {
    background: linear-gradient(180deg, rgba(249, 250, 255, 0.9), rgba(226, 240, 255, 0.8));
}

.lego-series-product-item.product-c {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.94), rgba(255, 232, 192, 0.8));
}

.lego-series-slider-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 0;
}

.lego-series-slider-button {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.lego-series-slider-button:hover {
    transform: translateY(-1px);
    border-color: rgba(51, 93, 255, 0.3);
    background: rgba(243, 247, 255, 0.96);
}

.popular-minifigure-section {
    gap: 16px;
}

.popular-minifigure-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.popular-minifigure-heading .eyebrow {
    margin: 0;
}

.popular-minifigure-heading h2 {
    margin: 0;
}

.popular-minifigure-section .popular-minifigure-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.popular-minifigure-grid .popular-minifigure-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.popular-minifigure-grid .popular-minifigure-card > img,
.popular-minifigure-image-placeholder {
    width: 100%;
    height: 180px;
}

.popular-minifigure-grid .popular-minifigure-card > img {
    object-fit: cover;
}

.popular-minifigure-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.1);
    color: var(--muted);
    font-size: 0.85rem;
}

.popular-minifigure-info {
    padding: 12px;
}

.popular-minifigure-info h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 0.95rem;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .popular-minifigure-section .popular-minifigure-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .popular-minifigure-section .popular-minifigure-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .popular-minifigure-grid .popular-minifigure-card > img,
    .popular-minifigure-image-placeholder {
        height: 150px;
    }
}

.lego-series-list-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
}

.lego-series-list-wrap {
    display: grid;
    gap: 12px;
    padding: 12px 0;
}

.lego-series-list-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.lego-series-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 90px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(240,244,250,0.9));
    border: 1px solid rgba(203, 213, 225, 0.9);
}

.lego-series-mini-number {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lego-series-mini strong {
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    color: var(--text);
}

@keyframes lego-series-roll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.lego-hero .eyebrow {
    color: var(--muted);
}

.lego-hero-copy {
    display: grid;
    gap: 12px;
    padding: 4px 4px 0;
}

.lego-hero-copy h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -0.06em;
    color: var(--text);
}

.lego-hero .lead {
    margin: 0;
    color: var(--muted);
    max-width: 58ch;
}

.lego-hero-panel {
    position: relative;
    min-height: 180px;
    border-radius: 26px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.lego-hero-panel-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    height: 100%;
    gap: 18px;
    padding: 18px 18px 20px;
}

.lego-hero-tag {
    display: inline-flex;
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lego-hero-emoji {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1;
    filter: drop-shadow(0 6px 18px rgba(15, 23, 42, 0.08));
}

.lego-hero-label {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lego-hero-panel h3 {
    margin: 6px 0 0;
    font-size: 1.8rem;
    letter-spacing: -0.05em;
    color: var(--text);
}

.lego-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lego-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
}

.lego-toolbar-group,
.lego-toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.lego-toolbar-meta {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(215, 221, 229, 0.95);
    background: #fbfcfe;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.chip.active {
    background: rgba(51, 93, 255, 0.1);
    border-color: rgba(51, 93, 255, 0.2);
    color: var(--accent);
}

.lego-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.lego-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(215, 221, 229, 0.9);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.lego-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
}

.lego-card-art {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    padding: 20px;
}

.lego-card-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 3rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.lego-card-body {
    display: grid;
    gap: 14px;
    padding: 18px 18px 20px;
}

.lego-badge {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-accent) 14%, white);
    border: 1px solid color-mix(in srgb, var(--card-accent) 30%, #dfe7f5);
    color: var(--card-accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lego-card-body h3 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
}

.lego-card-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.lego-meta-row,
.lego-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lego-meta-row {
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.lego-tag-row {
    gap: 8px;
}

.lego-tag {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f3f6ff;
    border: 1px solid rgba(215, 221, 229, 0.9);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 700;
}

.lego-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-top: 8px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(215, 221, 229, 0.9);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.page-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(51, 93, 255, 0.25);
}

.page-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.product-page {
    padding: 28px 0 80px;
}

.product-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.product-breadcrumb {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.product-list-shell > .product-breadcrumb {
    justify-content: flex-start;
    margin: 12px 0;
}

.product-list-shell > .product-breadcrumb .home-mark {
    color: inherit;
    text-decoration: none;
}

.home-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1rem;
}

.home-icon {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.breadcrumb-separator {
    color: #a3a3a3;
    font-size: 1.1rem;
    line-height: 1;
}

.page-title {
    margin: 14px 0 14px;
    text-align: center;
    font-size: 28px;
    letter-spacing: -0.06em;
    font-weight: 700;
}

.series-filter-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0;
}

.series-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.series-chip.is-active {
    background: rgba(51, 93, 255, 0.1);
    border-color: #335dff;
    color: #2445c2;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(51, 93, 255, 0.14);
}

.series-chip:hover {
    transform: translateY(-1px);
    border-color: #b5b5b5;
}

.items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    padding-top: 8px;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.items-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.items-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
}

.items-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sort-select {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #171717;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    font-size: 0.9rem;
    color: var(--text);
}

.sort-select select {
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px 18px;
    margin-top: 22px;
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 8px 22px rgba(17, 17, 17, 0.04);
}

.product-card > img {
    width: calc(100% + 28px);
    aspect-ratio: 1;
    object-fit: cover;
    margin: -14px -14px 0;
    border-radius: 17px 17px 0 0;
    background: linear-gradient(180deg, #f7f7f7, #ececec);
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% + 28px);
    aspect-ratio: 1;
    margin: -14px -14px 0;
    border-radius: 17px 17px 0 0;
    background: linear-gradient(180deg, #f7f7f7, #ececec);
    color: var(--muted);
    font-size: 0.9rem;
}

.product-emoji {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 26px;
    font-size: 5.3rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(17, 17, 17, 0.04);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.08));
}

.product-meta {
    display: grid;
    gap: 8px;
    padding: 4px 2px 2px;
}

.product-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-card-price strong {
    font-size: 0.9rem;
}

.product-card-price del {
    color: var(--muted);
    font-size: 0.76rem;
}

.product-card-stock {
    color: #b42318;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-list-empty {
    grid-column: 1 / -1;
    padding: 48px 16px;
    color: var(--muted);
    text-align: center;
}

.product-list-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}

.product-list-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.product-list-pagination a.is-active {
    background: #111;
    color: #fff;
}

.product-label {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-card h2 {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.45;
    letter-spacing: -0.03em;
    font-weight: 600;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 2.9em;
}

.product-card {
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: rgba(17, 17, 17, 0.2);
    box-shadow: 0 14px 28px rgba(17, 17, 17, 0.08);
}

.product-detail-shell {
    padding: 12px 0 80px;
}

.product-detail-shell .product-breadcrumb {
    justify-content: flex-start;
    margin: 0 0 28px;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 64px;
    align-items: start;
}

.product-detail-gallery {
    display: grid;
    gap: 14px;
}

.product-detail-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 560px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(17, 17, 17, 0.08);
    background: linear-gradient(145deg, #f7f8f4, #e8edf2);
}

.product-detail-image::before {
    content: "";
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(17, 17, 17, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
}

.product-detail-image img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 560px;
    object-fit: cover;
}

.product-detail-image-placeholder {
    position: relative;
    z-index: 1;
    color: var(--muted);
}

.product-detail-thumbnails {
    display: flex;
    gap: 10px;
}

.product-detail-thumbnail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.product-detail-thumbnail img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.product-detail-thumbnail.is-active { border: 2px solid var(--text); }

.product-detail-info {
    padding-top: 12px;
}

.product-detail-label {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.product-detail-info h1 {
    margin: 0;
    max-width: 18ch;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.25;
    letter-spacing: -0.05em;
}

.product-detail-description {
    margin: 22px 0;
    color: var(--muted);
    line-height: 1.8;
}

.product-detail-meta {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 18px 0;
    border-top: 1px solid var(--border);
}

.product-detail-meta > div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 14px;
    font-size: 0.9rem;
}

.product-detail-meta dt {
    color: var(--muted);
}

.product-detail-meta dd {
    margin: 0;
    font-weight: 700;
}

.product-detail-description-section {
    margin-top: 96px;
    border-top: 1px solid var(--text);
}

.product-detail-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-bottom: 1px solid var(--border);
}

.product-detail-tabs button {
    min-height: 64px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.product-detail-tabs button.is-active { border-bottom-color: var(--text); color: var(--text); }

.product-detail-tab-panel[hidden] { display: none; }

.product-detail-copy {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px 0;
    text-align: center;
}

.product-inventory-panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px 0;
}

.product-inventory-specs {
    display: grid;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--border);
}

.product-inventory-specs > div {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 2fr;
    gap: 16px;
    padding: 18px 12px;
    border-bottom: 1px solid var(--border);
}

.product-inventory-specs dt { color: var(--muted); }
.product-inventory-specs dd { margin: 0; font-weight: 700; }
.product-inventory-specs .is-in-stock { color: var(--success); }
.product-inventory-specs .is-out-of-stock { color: var(--danger); }

.product-detail-copy h2 { margin: 0 0 16px; font-size: 2rem; letter-spacing: -0.05em; }
.product-detail-copy > p:not(.product-detail-label) { margin: 0; color: var(--muted); line-height: 1.8; }

.product-detail-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 52px;
    text-align: left;
}

.product-detail-feature-grid > div { padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, 0.5); }
.product-detail-feature-grid span { color: var(--accent); font-size: 0.76rem; font-weight: 800; }
.product-detail-feature-grid strong { display: block; margin-top: 14px; }
.product-detail-feature-grid p { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }

@media (max-width: 1100px) {
    .series-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product-detail-image {
        aspect-ratio: 1;
        min-height: 0;
    }

    .product-detail-image img {
        height: 100%;
        object-fit: contain;
    }

    .lego-series-slide {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 8px;
    }

    .lego-series-slide-visual {
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
        border-radius: 16px;
    }

    .lego-series-image-frame,
    .lego-series-image-main {
        border-radius: 14px;
    }

    .lego-series-slide-copy {
        padding: 0 4px 8px;
    }

    .lego-series-slide-copy h3 {
        font-size: 1.5rem;
    }

    .lego-series-product-item {
        height: auto;
        min-height: 0;
        aspect-ratio: 1;
        border-radius: 10px;
    }

    .lego-series-slider-wrap {
        border-radius: 16px;
    }

    .product-detail-description-section {
        margin-top: 56px;
    }

    .product-detail-copy {
        padding: 48px 0;
    }

    .product-inventory-panel {
        padding: 48px 0;
    }

    .product-inventory-specs > div {
        grid-template-columns: minmax(100px, 1fr) 2fr;
        padding: 16px 8px;
    }

    .product-detail-feature-grid {
        grid-template-columns: 1fr;
        margin-top: 36px;
    }

    .product-breadcrumb {
        justify-content: center;
    }

    .series-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .items-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 10px;
    }

    .product-card {
        gap: 8px;
        padding: 10px;
        border-radius: 12px;
    }

    .product-card > img,
    .product-image-placeholder {
        width: calc(100% + 20px);
        margin: -10px -10px 0;
        border-radius: 11px 11px 0 0;
    }

    .product-meta {
        gap: 6px;
    }

    .product-card-price {
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .series-chip {
        min-height: 44px;
    }

    .items-header {
        margin: 10px 0;
    }

    .lego-series-slider-heading {
        gap: 8px;
    }

    .lego-series-rank-navigation {
        gap: 4px;
    }

    .lego-series-rank-button {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

.lego-site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.lego-site-header-inner {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
}

.lego-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lego-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.05rem;
}

.lego-site-brand-logo {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.lego-site-brand .lego-site-brand-logo {
    width: 75px;
    height: 65px;
    object-fit: fill;
}

.lego-mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.lego-mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.lego-site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.lego-site-nav a {
    color: var(--muted);
    font-weight: 600;
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
}

.lego-site-nav a:hover,
.lego-site-nav a.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.lego-nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.lego-nav-item.has-mega {
    /* extends the hoverable area downward so the pointer doesn't leave the item
       while crossing the gap to reach the mega menu below */
    padding-bottom: 6px;
    margin-bottom: -6px;
}

.lego-nav-item.has-mega > a::after {
    content: "▾";
    margin-left: 6px;
    font-size: 0.7rem;
}

.lego-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    display: none;
    grid-template-columns: repeat(3, max-content);
    gap: 0;
    width: max-content;
    max-width: calc(100vw - 40px);
    overflow-x: auto;
    padding: 16px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(22, 34, 58, 0.16);
}

.lego-mega-menu-secondary {
    grid-template-columns: repeat(4, max-content);
}

.storage-menu {
    grid-template-columns: repeat(2, max-content);
    gap: 12px;
}

.lego-nav-item.has-mega:hover .lego-mega-menu,
.lego-nav-item.has-mega:focus-within .lego-mega-menu {
    display: grid;
}

.lego-mega-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: max-content;
    padding: 8px 14px;
    border-right: 1px solid #e8edf4;
}

.lego-mega-col:last-child {
    border-right: 0;
}

.lego-mega-title {
    margin: 0;
    padding-bottom: 10px;
    color: #17243b;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.4;
    border-bottom: 2px solid #e8edf4;
    white-space: nowrap;
}

.lego-subgroup {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
    margin-top: 0;
    border-top: 1px solid #e8edf4;
}

.lego-subgroup:first-of-type {
    margin-top: 0;
    padding-top: 2px;
    border-top: none;
}

.lego-subgroup-title {
    margin: 0 0 2px;
    color: #66758b;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.lego-mega-meta {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.72rem;
}

.lego-mega-col a {
    padding: 4px 8px 4px 20px;
    color: #52627a;
    font-weight: 500;
    font-size: 0.84rem;
    border-bottom: none;
    border-radius: 6px;
    line-height: 1.4;
    position: relative;
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}

.lego-mega-col a::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #7088ff;
}

.lego-mega-col a:hover {
    color: #2348d8;
    background: #f0f4ff;
    border-bottom: none;
}

.lego-site-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lego-header-tools {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.lego-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    height: 42px;
    padding: 0 14px 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.lego-search-icon {
    order: 2;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
}

.lego-search input {
    order: 1;
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
}

.lego-search input::placeholder {
    color: var(--muted);
}

.lego-site-footer {
    margin-top: 32px;
    border-top: 1px solid #e2ded5;
    background: #f0ede6;
    color: #475569;
}

.lego-site-footer-inner {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 18px;
    padding: 20px 0 24px;
    align-items: start;
}

.lego-site-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #243447;
}

.lego-site-footer-brand-heading {
    color: #243447;
}

.lego-site-footer-brand-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lego-site-footer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.lego-site-footer-info p,
.lego-site-footer-brand p {
    margin: 0;
}

.lego-site-footer-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.82rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.lego-site-footer-links a:hover {
    color: var(--accent);
}

.mobile-menu-backdrop,
.mobile-menu-panel {
    display: none;
}

@media (max-width: 720px) {
    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }

    .lego-hero {
        grid-template-columns: 1fr;
    }

    .lego-grid {
        grid-template-columns: 1fr;
    }

    .lego-mobile-menu-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
    }

    .lego-site-header-inner {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) minmax(92px, clamp(92px, 30vw, 112px));
        grid-template-areas: "menu brand tools";
        gap: 0 10px;
        width: calc(100% - 24px);
        min-height: 0;
        padding: 8px 0 0;
    }

    .lego-header-left {
        display: contents;
    }

    .lego-mobile-menu-toggle {
        grid-area: menu;
    }

    .lego-site-brand {
        grid-area: brand;
        justify-self: start;
    }

    .lego-site-brand .lego-site-brand-logo {
        width: 56px;
        height: 56px;
        object-fit: contain;
    }

    .lego-site-nav {
        display: none;
    }

    .mobile-menu-backdrop {
        position: fixed;
        z-index: 80;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(15, 23, 42, 0.56);
        opacity: 0;
        visibility: hidden;
        transition: opacity 220ms ease, visibility 220ms ease;
    }

    .mobile-menu-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-panel {
        position: fixed;
        z-index: 81;
        inset: 0 auto 0 0;
        display: flex;
        flex-direction: column;
        width: min(86vw, 360px);
        padding: 0 20px env(safe-area-inset-bottom);
        overflow-y: auto;
        background: #fff;
        box-shadow: 16px 0 44px rgba(15, 23, 42, 0.18);
        transform: translateX(-105%);
        transition: transform 240ms ease;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .mobile-menu-panel.is-open {
        transform: translateX(0);
    }

    .mobile-menu-panel-header {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 64px;
        border-bottom: 1px solid var(--border);
        background: #fff;
        font-size: 1.05rem;
        font-weight: 700;
    }

    .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 1.8rem;
        cursor: pointer;
    }

    .mobile-category-list {
        margin: 0;
        padding: 8px 0;
        list-style: none;
    }

    .mobile-category-item {
        border-bottom: 1px solid #edf0f4;
    }

    .mobile-category-row {
        display: flex;
        align-items: center;
        min-height: 52px;
    }

    .mobile-category-row > a,
    .mobile-category-row > .mobile-category-label {
        display: flex;
        flex: 1;
        align-items: center;
        min-width: 0;
        min-height: 52px;
        padding: 8px 4px;
        color: var(--text);
        font-size: 0.96rem;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .mobile-category-toggle {
        display: inline-flex;
        flex: 0 0 44px;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: var(--text);
        font-size: 1.25rem;
        cursor: pointer;
    }

    .mobile-category-toggle:focus-visible,
    .mobile-menu-close:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: -2px;
    }

    .mobile-category-children {
        padding-left: 14px;
        border-left: 1px solid var(--border);
    }

    .mobile-category-children .mobile-category-row > a,
    .mobile-category-children .mobile-category-row > .mobile-category-label {
        color: #475569;
        font-size: 0.9rem;
        font-weight: 500;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .lego-mega-col {
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .lego-mega-col:last-child {
        border-bottom: 0;
    }

    .lego-site-footer-inner {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 0 20px;
    }

    .lego-header-tools {
        grid-area: tools;
        width: 100%;
        margin: 0;
    }

    .lego-search {
        min-width: 0;
        width: 100%;
        height: 44px;
        padding: 0 8px;
    }

    .lego-page {
        gap: 10px;
        padding-top: 12px;
    }

    .lego-page .dashboard-card {
        padding: 16px;
    }

    .product-shell {
        width: calc(100% - 24px);
    }

    .product-detail-shell {
        padding-bottom: 48px;
    }

    .product-detail-shell .product-breadcrumb {
        justify-content: flex-start;
        flex-wrap: wrap;
        margin-bottom: 18px;
    }

    .product-detail-tabs button {
        min-height: 52px;
    }
}