:root {
    color-scheme: light;
    --paper: #fbf7ff;
    --surface: #ffffff;
    --ink: #201425;
    --muted: #6f6276;
    --line: #e5d7ea;
    --purple: #7430a4;
    --purple-dark: #4c1d65;
    --plum: #27122f;
    --rose: #b43c82;
    --gold: #bf963a;
    --violet: #6d4fb3;
    --shadow: 0 18px 55px rgba(32, 20, 37, 0.15);
    --radius: 8px;
    --tap: 44px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.drawer-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

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

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

.site-shell {
    min-height: 100vh;
}

.topbar {
    align-items: center;
    background: rgba(251, 247, 255, 0.96);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    left: 0;
    padding: 14px clamp(16px, 4vw, 48px);
    position: sticky;
    right: 0;
    top: 0;
    z-index: 20;
}

.brand {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    aspect-ratio: 1;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(32, 20, 37, 0.18);
    flex: 0 0 52px;
    height: 52px;
    object-fit: cover;
    width: 52px;
}

.brand strong,
.brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand strong {
    font-size: clamp(0.98rem, 2vw, 1.1rem);
}

.brand small {
    color: var(--muted);
    font-size: 0.78rem;
}

.nav {
    display: inline-flex;
    gap: 8px;
}

.nav a {
    border-radius: 999px;
    color: var(--muted);
    padding: 8px 12px;
}

.nav a:hover,
.nav a:focus-visible {
    background: #f0e6f6;
    color: var(--ink);
}

.cart-button,
.icon-button {
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    display: inline-flex;
    height: var(--tap);
    justify-content: center;
    min-width: var(--tap);
}

.cart-button {
    border-radius: 999px;
    gap: 8px;
    padding: 0 14px;
}

.cart-button:hover,
.icon-button:hover {
    border-color: var(--purple);
}

.cart-icon,
.search-icon {
    display: inline-block;
    position: relative;
}

.cart-icon {
    border: 2px solid currentColor;
    border-top: 0;
    height: 15px;
    width: 18px;
}

.cart-icon::before {
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    content: "";
    height: 8px;
    left: 4px;
    position: absolute;
    top: -8px;
    width: 7px;
}

.shop-hero {
    align-items: center;
    background: var(--plum);
    color: var(--paper);
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    min-height: 390px;
    padding: clamp(34px, 7vw, 78px) clamp(16px, 4vw, 48px) 34px;
}

.hero-copy {
    max-width: 820px;
}

.eyebrow {
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.shop-hero h1 {
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    line-height: 0.96;
    margin: 0;
}

.shop-hero p:not(.eyebrow) {
    color: #e9dff0;
    font-size: clamp(1rem, 2.1vw, 1.25rem);
    margin: 18px 0 0;
    max-width: 650px;
}

.hero-side {
    align-self: stretch;
    display: grid;
    gap: 16px;
    justify-items: end;
}

.hero-logo {
    aspect-ratio: 1;
    border: 6px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--radius);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    height: min(240px, 30vw);
    object-fit: cover;
    width: min(240px, 30vw);
}

.hero-actions {
    display: grid;
    gap: 12px;
    grid-template-rows: auto auto;
    max-width: 420px;
    width: 100%;
}

.search-box {
    align-items: center;
    background: var(--surface);
    border: 1px solid #efe3f5;
    border-radius: var(--radius);
    display: flex;
    gap: 10px;
    min-height: 54px;
    padding: 0 14px;
}

.search-icon {
    border: 2px solid var(--muted);
    border-radius: 50%;
    height: 17px;
    width: 17px;
}

.search-icon::after {
    background: var(--muted);
    content: "";
    height: 8px;
    position: absolute;
    right: -5px;
    top: 12px;
    transform: rotate(45deg);
    width: 2px;
}

.search-box input {
    border: 0;
    color: var(--ink);
    min-width: 0;
    outline: 0;
    width: 100%;
}

.primary-button,
.secondary-button,
.product-bottom button,
.category-option,
.filter-heading button {
    align-items: center;
    border-radius: var(--radius);
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: var(--tap);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
    background: var(--purple);
    border: 1px solid var(--purple);
    color: white;
    padding: 0 18px;
}

.primary-button:hover,
.product-bottom button:hover {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
}

.secondary-button {
    background: transparent;
    border: 1px solid rgba(251, 247, 255, 0.58);
    color: var(--paper);
    padding: 0 18px;
}

.secondary-button:hover {
    border-color: var(--paper);
}

.full {
    width: 100%;
}

.notice {
    background: #fff6dd;
    border-bottom: 1px solid #ead8a1;
    color: #624612;
    padding: 12px clamp(16px, 4vw, 48px);
}

.hidden {
    display: none !important;
}

.catalog-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: 250px minmax(0, 1fr);
    padding: 28px clamp(16px, 4vw, 48px) 56px;
}

.filters {
    background: #fffbff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    position: sticky;
    top: 88px;
}

.filter-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-heading span {
    font-weight: 850;
}

.filter-heading button {
    background: transparent;
    border: 0;
    color: var(--purple);
    min-height: 32px;
    padding: 0 4px;
}

.category-list {
    display: grid;
    gap: 8px;
}

.category-option {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    gap: 8px;
    justify-content: space-between;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.category-option.active,
.category-option:hover {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

.category-option span:first-child {
    overflow-wrap: anywhere;
}

.category-option span:last-child {
    color: var(--gold);
    font-size: 0.85rem;
}

.filter-group {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
}

.filter-group label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

select,
input,
textarea {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    min-height: var(--tap);
    padding: 10px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.product-area {
    min-width: 0;
}

.catalog-summary {
    align-items: end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.catalog-summary h2 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.05;
    margin: 0;
}

.catalog-summary p:last-child {
    color: var(--muted);
    margin: 0;
}

.product-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 22px rgba(32, 20, 37, 0.07);
    display: grid;
    overflow: hidden;
}

.image-button {
    aspect-ratio: 1 / 0.82;
    background: #f1e8f6;
    border: 0;
    display: block;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.image-button img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.product-info {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.product-kicker {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.product-category {
    color: var(--violet);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.stock-pill {
    background: #f0e6f7;
    border-radius: 999px;
    color: #5b237c;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 8px;
    white-space: nowrap;
}

.stock-pill.sold-out {
    background: #f9e3ef;
    color: #933569;
}

.product-card h3 {
    font-size: 1.08rem;
    line-height: 1.2;
    margin: 0;
}

.product-card p {
    color: var(--muted);
    display: -webkit-box;
    font-size: 0.92rem;
    margin: 0;
    min-height: 2.75em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-bottom {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.product-bottom strong {
    font-size: 1.05rem;
}

.product-bottom button {
    background: var(--purple);
    border: 1px solid var(--purple);
    color: #fff;
    min-width: 94px;
    padding: 0 12px;
}

.product-bottom button:disabled {
    background: #ddd2e4;
    border-color: #ddd2e4;
    color: #75687e;
    cursor: not-allowed;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 42px;
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 8px;
}

.empty-state p {
    color: var(--muted);
    margin: 0;
}

.custom-section {
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr);
    padding: 56px clamp(16px, 4vw, 48px);
}

.custom-copy h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    margin: 0 0 14px;
}

.custom-copy p:last-child {
    color: var(--muted);
    max-width: 520px;
}

.custom-form {
    display: grid;
    gap: 14px;
}

.field-row {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custom-form label,
.dialog-copy label {
    color: var(--muted);
    display: grid;
    font-size: 0.86rem;
    font-weight: 800;
    gap: 7px;
}

.custom-form label span,
.dialog-copy label span {
    color: var(--ink);
}

.form-message,
.checkout-message {
    color: var(--muted);
    margin: 0;
    min-height: 1.5em;
}

.footer {
    align-items: center;
    background: var(--plum);
    color: var(--paper);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px clamp(16px, 4vw, 48px);
}

.footer strong,
.footer span {
    display: block;
}

.footer span,
.footer-links {
    color: #ddd2e5;
}

.footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.drawer-backdrop {
    background: rgba(0, 0, 0, 0.35);
    inset: 0;
    position: fixed;
    z-index: 40;
}

.cart-drawer {
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    max-width: 440px;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform 180ms ease;
    width: min(100vw, 440px);
    z-index: 50;
}

.cart-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    align-items: start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px;
}

.drawer-header h2 {
    margin: 0;
}

.icon-button {
    border-radius: 50%;
    flex: 0 0 var(--tap);
    position: relative;
}

.close-button::before,
.close-button::after {
    background: currentColor;
    content: "";
    height: 2px;
    left: 13px;
    position: absolute;
    top: 21px;
    width: 16px;
}

.close-button::before {
    transform: rotate(45deg);
}

.close-button::after {
    transform: rotate(-45deg);
}

.cart-items {
    display: grid;
    gap: 14px;
    overflow: auto;
    padding: 18px;
}

.cart-line {
    display: grid;
    gap: 12px;
    grid-template-columns: 74px minmax(0, 1fr);
}

.cart-line img {
    aspect-ratio: 1;
    border-radius: var(--radius);
    object-fit: cover;
}

.cart-line h3 {
    font-size: 0.98rem;
    line-height: 1.25;
    margin: 0;
}

.cart-line p {
    color: var(--muted);
    margin: 2px 0 8px;
}

.cart-controls {
    align-items: center;
    display: flex;
    gap: 8px;
}

.qty-button {
    align-items: center;
    background: #f4edf8;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.remove-button {
    background: transparent;
    border: 0;
    color: var(--rose);
    font-weight: 800;
    margin-left: auto;
}

.cart-note {
    grid-column: 1 / -1;
}

.cart-note textarea {
    min-height: 72px;
}

.cart-footer {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding: 18px;
}

.cart-total {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.cart-total strong {
    font-size: 1.3rem;
}

.product-dialog {
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: min(920px, calc(100vw - 28px));
    padding: 0;
    width: 920px;
}

.product-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.dialog-body {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr);
    margin: 0;
    position: relative;
}

.dialog-body img {
    aspect-ratio: 1;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.dialog-copy {
    align-content: center;
    display: grid;
    gap: 14px;
    padding: clamp(22px, 4vw, 38px);
}

.dialog-copy h2,
.dialog-copy p {
    margin: 0;
}

.dialog-copy p {
    color: var(--muted);
}

.dialog-close {
    position: absolute;
    right: 12px;
    top: 12px;
}

@media (max-width: 860px) {
    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .nav {
        display: none;
    }

    .shop-hero,
    .catalog-layout,
    .custom-section {
        grid-template-columns: 1fr;
    }

    .shop-hero {
        min-height: auto;
    }

    .hero-side {
        justify-items: start;
    }

    .hero-logo {
        height: min(220px, 70vw);
        width: min(220px, 70vw);
    }

    .filters {
        position: static;
    }

    .category-list {
        display: flex;
        gap: 8px;
        overflow: auto;
        padding-bottom: 4px;
    }

    .category-option {
        flex: 0 0 auto;
        min-width: 140px;
    }

    .catalog-summary {
        align-items: start;
        flex-direction: column;
    }

    .field-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .brand small {
        display: none;
    }

    .brand-logo {
        flex-basis: 38px;
        height: 38px;
        width: 38px;
    }

    .shop-hero {
        padding-top: 34px;
    }

    .hero-logo {
        height: min(170px, 58vw);
        width: min(170px, 58vw);
    }

    .product-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }

    .dialog-body {
        grid-template-columns: 1fr;
    }

    .dialog-body img {
        max-height: 42vh;
    }
}
