/* ==========================================================================
   Ethereal By Iqra — core
   Tokens, type, buttons, forms, badges and notices shared by the shop and
   the admin panel. Colours are set by Admin → Settings → Colours & fonts
   (printed as a :root block after this file); the values below are only
   the fallback "Ribbon" palette.
   ========================================================================== */

:root {
    --primary: #d92f6a;
    --primary-2: #b8235a;
    --on-primary: #ffffff;
    --accent: #ffc94d;
    --on-accent: #2a1720;
    --soft: #ffe4ec;
    --soft-2: #fff1f4;
    --page: #fff8f6;
    --surface: #ffffff;
    --ink: #2a1720;
    --ink-2: rgba(42, 23, 32, 0.74);
    --ink-3: rgba(42, 23, 32, 0.54);
    --line: rgba(42, 23, 32, 0.1);
    --line-2: rgba(42, 23, 32, 0.2);
    --primary-tint: rgba(217, 47, 106, 0.08);
    --accent-tint: rgba(255, 201, 77, 0.2);

    --ok: #2f6b4f;
    --ok-tint: rgba(47, 107, 79, 0.1);
    --warn: #8a5a12;
    --warn-tint: rgba(196, 140, 40, 0.14);
    --bad: #a3322a;
    --bad-tint: rgba(163, 50, 42, 0.09);

    --f-display: 'Fraunces', Georgia, serif;
    --f-script: 'Allura', cursive;
    --f-body: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;

    /* A modular scale (1.25) for type. */
    --t-xs: 0.78rem;
    --t-sm: 0.875rem;
    --t-md: 1rem;
    --t-lg: 1.25rem;
    --t-xl: 1.56rem;
    --t-2xl: 1.95rem;
    --t-3xl: 2.44rem;
    --t-4xl: 3.05rem;

    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 999px;
    /* The arch: the shop's one signature shape, used for hero and category frames. */
    --r-arch: 999px 999px var(--r-sm) var(--r-sm);

    --shadow-1: 0 1px 2px rgba(20, 12, 22, 0.05);
    --shadow-2: 0 18px 40px -22px rgba(20, 12, 22, 0.35);

    --wrap: 1280px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Older token names still used in a few inline styles. */
    --sp-1: var(--s-1); --sp-2: var(--s-2); --sp-3: var(--s-3); --sp-4: var(--s-4); --sp-5: var(--s-5);
    --sp-6: var(--s-6); --sp-7: var(--s-7); --sp-8: var(--s-8); --sp-9: var(--s-9);
    --step--1: var(--t-sm); --step-0: var(--t-md); --step-1: var(--t-lg); --step-2: var(--t-xl); --step-3: var(--t-2xl);
    --radius: var(--r-md); --hairline: var(--line); --border: 1px solid var(--line); --alert: var(--bad);
    --ink-12: var(--line); --ink-35: var(--ink-3); --on-dark: #ffffff; --mist: var(--soft-2); --clay: var(--soft); --bubblegum: var(--soft);
}

/* ------------------------------------------------------------- reset ---- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: var(--t-md);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); }
p { margin: 0 0 var(--s-4); }

/* Display type: the light, tall serif. Used only at large sizes. */
.display {
    font-family: var(--f-display);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.02;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ----------------------------------------------------------- utilities -- */

.muted { color: var(--ink-3); }
.tabular, .num { font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.stack { display: grid; gap: var(--s-3); }
.spacer { flex: 1; }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 44px;
    padding: 0 var(--s-5);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--t-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-outline { background: transparent; border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { filter: brightness(0.94); }
.btn-quiet { background: transparent; color: var(--ink-2); padding-inline: var(--s-3); }
.btn-quiet:hover { background: var(--primary-tint); color: var(--ink); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 var(--s-4); font-size: var(--t-xs); }
.btn-lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--t-md); }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: 0.45; cursor: not-allowed; }

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}
.icon-btn:hover { background: var(--primary-tint); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* -------------------------------------------------------------- forms ---- */

.field { margin-bottom: var(--s-4); }
.field > label, .label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--ink);
}
.input, .select, .textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: var(--t-md);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.input[readonly] { background: var(--soft-2); }
.input-sm { min-height: 38px; padding: 6px 10px; font-size: var(--t-sm); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23777' stroke-width='1.4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}
select[multiple].select { background-image: none; padding-right: 14px; }
.has-error { border-color: var(--bad) !important; }
.field-hint { margin-top: 6px; font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }
.field-error { margin-top: 6px; font-size: var(--t-xs); color: var(--bad); font-weight: 500; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--t-sm); cursor: pointer; line-height: 1.45; }
.check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); }

/* ------------------------------------------------------------- badges ---- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--soft);
    color: var(--ink);
    font-size: var(--t-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-success { background: var(--ok-tint); color: var(--ok); }
.badge-low { background: var(--warn-tint); color: var(--warn); }
.badge-out { background: var(--bad-tint); color: var(--bad); }
.badge-sale { background: var(--primary); color: var(--on-primary); }
.badge-new { background: var(--surface); color: var(--ink); }

/* ------------------------------------------------------------ notices ---- */

.notice {
    display: flex;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--soft-2);
    border: 1px solid var(--line);
    font-size: var(--t-sm);
    line-height: 1.55;
}
.notice-title { display: block; margin-bottom: 2px; }
.notice-success { background: var(--ok-tint); border-color: transparent; }
.notice-warn { background: var(--warn-tint); border-color: transparent; }
.notice-error { background: var(--bad-tint); border-color: transparent; color: var(--ink); }
.notice-error .notice-title { color: var(--bad); }

/* ------------------------------------------------- money and lists ------ */

.totals { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.totals li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 6px 0; color: var(--ink-2); }
.totals li span:last-child { color: var(--ink); }
.totals .is-discount, .totals .is-discount span:last-child { color: var(--ok); }
.totals .is-total { margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--t-lg); font-weight: 700; color: var(--ink); }
.totals .is-note { font-size: var(--t-xs); color: var(--ink-3); }

.mini-items { list-style: none; margin: 0 0 var(--s-4); padding: 0; font-size: var(--t-sm); }
.mini-items li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 10px 0; border-bottom: 1px solid var(--line); }

/* -------------------------------------------------------------- tables -- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-weight: 600; color: var(--ink-3); }

/* ------------------------------------------------------------- toasts ---- */

.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 200; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
    padding: 12px 20px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--page);
    font-size: var(--t-sm);
    font-weight: 500;
    box-shadow: var(--shadow-2);
    animation: toast-in 0.25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------- pagination -- */

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: var(--s-6) 0 0; }
.pagination a, .pagination span {
    display: grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    font-size: var(--t-sm);
    text-decoration: none;
}
.pagination a:hover { background: var(--primary-tint); }
.pagination .is-current { background: var(--primary); color: var(--on-primary); }
.pagination .is-disabled { color: var(--ink-3); }

/* --------------------------------------------------------------- prose -- */

.prose { max-width: 68ch; color: var(--ink-2); line-height: 1.75; }
.prose h2, .prose h3 { color: var(--ink); margin-top: var(--s-6); }
.prose a { color: var(--primary); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s-4) 0; font-size: var(--t-sm); }
.prose th, .prose td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* ------------------------------------------------------- order timeline -- */

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline-step { position: relative; display: flex; gap: var(--s-3); padding: 0 0 var(--s-4) 0; }
.timeline-step::before { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline-step:last-child::before { display: none; }
.timeline-dot { flex: none; width: 15px; height: 15px; margin-top: 4px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); }
.timeline-step.is-done .timeline-dot { background: var(--primary); border-color: var(--primary); }
.timeline-step.is-current .timeline-dot { box-shadow: 0 0 0 4px var(--primary-tint); }
.timeline-label { display: flex; flex-direction: column; font-size: var(--t-sm); font-weight: 500; }
.timeline-label .muted { font-weight: 400; font-size: var(--t-xs); }
.timeline-step:not(.is-done) .timeline-label { color: var(--ink-3); }
.timeline-dead { display: flex; align-items: center; gap: var(--s-3); }

/* --------------------------------------------------------- empty state -- */

.empty { padding: var(--s-8) var(--s-5); text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty h3 { font-family: var(--f-display); font-weight: 400; font-size: var(--t-2xl); }
.empty p { color: var(--ink-3); max-width: 46ch; margin-inline: auto; }

/* ------------------------------------------------- tabs (settings etc.) -- */

.account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: var(--r-pill);
    background: var(--soft-2);
    width: fit-content;
    max-width: 100%;
}
.account-nav a {
    padding: 8px 16px;
    border-radius: var(--r-pill);
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
}
.account-nav a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Material chips (kept for the order history and admin). */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-3); }
.chip-swatch { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.chip-label { font-weight: 600; color: var(--ink-2); }
