@font-face {
    font-family: "Luxerie";
    src: url("/brand/fonts/Luxerie.ttf") format("truetype");
}

@font-face {
    font-family: "Open Sans Tesoria";
    src: url("/brand/fonts/OpenSans.ttf") format("truetype");
}

:root {
    --bruma: #9190c4;
    --indigo: #291e56;
    --roble: #342626;
    --paper: #faf8f4;
    --surface: #fff;
    --surface-muted: #eeeaf9;
    --surface-admin: #f3f0ea;
    --line: #ded7cf;
    --muted: #756c66;
    --success: #2f694d;
    --danger: #a03939;
    --warning: #8a5a00;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--roble);
    background: var(--paper);
    font-family: "Open Sans Tesoria", system-ui, sans-serif;
}

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

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

button,
.button {
    cursor: pointer;
}

.site-header,
.admin-shell {
    display: grid;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    min-height: 74px;
    padding: 12px clamp(18px, 5vw, 60px);
    background: rgba(250, 248, 244, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
}

.brand-logo img {
    width: 28px;
    height: auto;
    max-height: 42px;
    object-fit: contain;
    object-position: left center;
}

.brand-logo span {
    color: var(--roble);
    font-weight: 900;
    font-size: 1.1rem;
}

.admin-sidebar .brand-logo span {
    color: #fff;
}

.admin-sidebar .brand-logo img {
    width: 28px;
}

.stat-value {
    margin: 0;
    color: var(--roble);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
}

.stat-value.compact {
    font-size: 2.2rem;
}

.main-nav,
.admin-nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.main-nav {
    justify-content: center;
}

.main-nav a,
.admin-nav a {
    font-weight: 800;
    font-size: 0.92rem;
}

.shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.shell.narrow {
    max-width: 760px;
}

.shell.auth-shell {
    max-width: 560px;
}

.flash-shell {
    padding-top: 18px;
}

.hero {
    min-height: min(700px, 88svh);
    display: grid;
    align-items: end;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(41, 30, 86, 0.94), rgba(41, 30, 86, 0.52)),
        url("/brand/covers/portal-indigo.png") center / cover;
}

.hero-inner {
    width: min(860px, calc(100% - 36px));
    margin: 0 auto clamp(44px, 8vw, 90px);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--bruma);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
.display {
    font-family: "Luxerie", Georgia, serif;
    letter-spacing: 0;
}

h1 {
    max-width: 820px;
    margin-bottom: 18px;
    font-size: 5rem;
    line-height: 0.96;
}

h2 {
    font-size: 3.2rem;
    line-height: 1;
}

.page-title-xs {
    font-size: 3rem;
}

.page-title-sm {
    font-size: 3.4rem;
}

.page-title-md {
    font-size: 3.6rem;
}

.page-title-lg {
    font-size: 3.8rem;
}

.page-title-xl {
    font-size: 4rem;
}

.admin-heading-title {
    margin: 0;
    font-size: 2.8rem;
}

.admin-card-title {
    font-size: 2rem;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

.hero p {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.12rem;
}

.home-hero {
    position: relative;
    min-height: min(760px, 88svh);
    overflow: hidden;
    color: #fff;
}

.home-hero::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(41, 30, 86, 0.94), rgba(41, 30, 86, 0.36)),
        linear-gradient(0deg, rgba(52, 38, 38, 0.36), rgba(52, 38, 38, 0));
    content: "";
}

.home-hero-media,
.home-hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.home-hero-media img {
    object-fit: cover;
}

.home-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: clamp(24px, 5vw, 62px);
    align-items: end;
    min-height: min(760px, 88svh);
    padding: clamp(52px, 9vw, 104px) 0;
}

.home-hero-copy {
    max-width: 760px;
}

.home-hero-copy p:not(.eyebrow),
.home-search-panel .help-text {
    color: rgba(255, 255, 255, 0.86);
}

.home-search-panel {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 8px;
    background: rgba(250, 248, 244, 0.94);
    color: var(--roble);
    box-shadow: 0 24px 64px rgba(20, 14, 45, 0.28);
}

.home-search-panel h2 {
    margin: 0;
    font-size: 2rem;
}

.home-search-panel .eyebrow,
.home-search-panel .help-text {
    color: var(--muted);
}

.quick-section {
    padding: 18px 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.quick-filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-filter-row a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--roble);
    font-size: 0.84rem;
    font-weight: 900;
}

.rule-section {
    padding: 18px 0;
    background: var(--surface-admin);
}

.rule-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: var(--indigo);
    color: #fff;
}

.rule-band div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.rule-band strong {
    font-size: 0.94rem;
}

.rule-band span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    line-height: 1.5;
}

.product-card .badge {
    margin-top: 8px;
}

.collection-feature {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 24px;
    align-items: stretch;
}

.collection-feature-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.collection-feature-copy .button {
    align-self: start;
}

.collection-feature-media {
    min-height: 360px;
    overflow: hidden;
    border-radius: 8px;
}

.collection-feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--roble);
    border-radius: 999px;
    background: var(--roble);
    color: #fff;
    font-weight: 900;
}

.button.secondary {
    background: #fff;
    color: var(--roble);
}

.button.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.section {
    padding: clamp(54px, 8vw, 96px) 0;
}

.section-muted {
    background: var(--surface-muted);
}

.section-dark {
    background: var(--indigo);
    color: #fff;
}

.section-dark p,
.section-inverse-copy {
    color: rgba(255, 255, 255, 0.82);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

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

.stack-sm {
    margin-top: 10px;
}

.stack-md {
    margin-top: 18px;
}

.stack-lg {
    margin-top: 22px;
}

.mb-sm {
    margin-bottom: 12px;
}

.mb-md {
    margin-bottom: 16px;
}

.card,
.panel,
.admin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 46px rgba(52, 38, 38, 0.08);
}

.card {
    overflow: hidden;
}

.card-media {
    aspect-ratio: 3 / 4;
    background: #e7e3df;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body,
.panel,
.admin-card {
    padding: 22px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.86rem;
}

.meta-row.start {
    justify-content: start;
}

.meta-row.top {
    align-items: start;
}

.meta-row.spaced {
    margin-bottom: 12px;
}

.price {
    font-size: 1.25rem;
    font-weight: 900;
}

.plan-price {
    margin-bottom: 6px;
    font-size: 3rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 24px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label,
.check-label {
    font-size: 0.82rem;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cfc6bd;
    border-radius: 8px;
    background: #fff;
    color: var(--roble);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.check-label {
    display: inline-flex;
    gap: 9px;
    align-items: center;
}

.check-label input {
    width: auto;
    min-height: auto;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ece8ff;
    color: var(--indigo);
    font-weight: 800;
}

.alert.error {
    background: #fee8e8;
    color: var(--danger);
}

.admin-body {
    background: var(--surface-admin);
}

.admin-shell {
    grid-template-columns: 260px 1fr;
    min-height: 100svh;
}

.admin-sidebar {
    padding: 24px;
    background: var(--indigo);
    color: #fff;
}

.admin-sidebar .brand-logo {
    margin-bottom: 28px;
}

.admin-sidebar img {
    filter: none;
}

.admin-nav {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
}

.admin-nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.admin-nav a.external {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.nav-section {
    margin: 16px 0 4px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-main {
    padding: 28px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--danger);
    font-weight: 900;
}

.badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: #ece8ff;
    color: var(--indigo);
    font-size: 0.78rem;
    font-weight: 900;
}

.badge.success {
    background: #e2f3ea;
    color: var(--success);
}

.badge.warning {
    background: #fff1d4;
    color: var(--warning);
}

.badge.danger {
    background: #fee8e8;
    color: var(--danger);
}

.help-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.flow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}

.flow-step {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.flow-step.active {
    border-color: var(--roble);
    background: var(--roble);
    color: #fff;
}

.flow-step.done {
    border-color: #c5dfcf;
    background: #e2f3ea;
    color: var(--success);
}

.admin-intro {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 22px;
}

.admin-intro h2 {
    margin-bottom: 0;
    font-size: 2.2rem;
}

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

.check-item {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #faf8f4;
}

.check-item span {
    color: var(--danger);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.check-item.done span {
    color: var(--success);
}

.check-item small {
    color: var(--muted);
}

.settings-form {
    display: grid;
    gap: 18px;
}

.settings-section {
    display: grid;
    gap: 18px;
}

.settings-heading h3 {
    margin: 0;
    font-size: 1.1rem;
}

.setting-toggle {
    min-height: 42px;
    align-items: center;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    gap: 10px;
    padding: 14px 0 0;
    background: linear-gradient(180deg, rgba(243, 240, 234, 0), #f3f0ea 35%);
}

.form-actions {
    margin-top: 18px;
}

.inline-actions {
    margin-top: 10px;
}

.thumbnail-grid {
    margin-top: 12px;
}

.thumbnail-square {
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-image {
    width: 88px;
    height: 112px;
    border-radius: 8px;
    object-fit: cover;
}

.summary-panel {
    margin-top: 22px;
}

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

.form-grid .span-2 {
    grid-column: span 2;
}

.pagination {
    margin-top: 18px;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 34px;
    align-items: start;
}

.detail-hero img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.logout-form {
    display: inline;
}

@media (max-width: 900px) {
    .site-header,
    .admin-shell,
    .admin-intro,
    .checklist,
    .home-hero-inner,
    .rule-band,
    .collection-feature,
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4,
    .detail-hero,
    .form-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 3.2rem;
    }

    .page-title-xs,
    .page-title-sm,
    .page-title-md,
    .page-title-lg,
    .page-title-xl,
    .admin-heading-title {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.4rem;
    }

    .main-nav {
        justify-content: start;
    }

    .admin-sidebar {
        position: static;
    }

    .form-grid .span-2 {
        grid-column: span 1;
    }
}
