/* ==========================================================================
   ChicoCharm — site stylesheet
   Every colour and size lives in the token block below. Never write a raw
   hex value anywhere else in this file or in a Blade template.
   ========================================================================== */

:root {
    /* ----------------------------------------------------------- palette --
       ChicoCharm: Rosewood and ivory. One deep rose for anything that acts,
       blush and gold as quiet accents, ivory pages, near-black ink.
    */
    --ivory:     #faf6f0;   /* page */
    --rosewood:  #7a2e3a;   /* primary: buttons, links, the announcement */
    --rose-deep: #64232e;   /* rosewood on hover */
    --blush:     #e8c4c0;
    --blush-soft:#f4e3e0;
    --gold:      #b8925a;
    --cream:     #f3ece2;
    --ink:       #2b1e22;   /* every word */

    /* Old names kept so every stylesheet inherits the palette unchanged. */
    --cloud:     var(--ivory);
    --sky:       var(--cream);
    --bubblegum: var(--blush-soft);
    --lemon:     var(--blush-soft);
    --mint:      var(--cream);
    --grape:     var(--blush-soft);
    --pop:       var(--rosewood);

    /* Page surfaces */
    --page:       var(--ivory);
    --ground:     #fdfaf6;   /* header and footer */
    --paper:      #fffdf9;
    --mist:       #f7f1e9;
    --on-dark:    #ffffff;
    --white:      #ffffff;

    --greige:     var(--cream);
    --sand:       var(--cream);
    --clay:       var(--blush);
    --brass:      var(--rosewood);
    --alert:      #b3261e;

    --ink-70:     rgba(43, 30, 34, 0.74);
    --ink-55:     rgba(43, 30, 34, 0.58);
    --ink-35:     rgba(43, 30, 34, 0.38);
    --ink-12:     rgba(43, 30, 34, 0.12);
    --ink-06:     rgba(43, 30, 34, 0.05);
    --brass-12:   rgba(122, 46, 58, 0.10);
    --alert-10:   rgba(179, 38, 30, 0.10);
    --success:    #3d7a52;
    --success-10: rgba(61, 122, 82, 0.12);
    --hairline:   rgba(43, 30, 34, 0.12);

    /* Hairlines instead of cartoon outlines; no offset shadows. */
    --outline:       1px solid var(--hairline);
    --outline-thin:  1px solid var(--hairline);
    --shadow-sticker: none;
    --shadow-sticker-lg: none;

    /* Type */
    --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
    --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --step--1: 0.855rem;
    --step-0:  1rem;
    --step-1:  1.2rem;
    --step-2:  1.55rem;
    --step-3:  2rem;
    --step-4:  2.6rem;
    --step-5:  3.4rem;

    /* Space */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;
    --sp-9: 6rem;

    /* Shape: crisp, tailored corners */
    --radius-sm: 2px;
    --radius:    4px;
    --radius-lg: 6px;
    --radius-pill: 999px;

    --border: var(--outline-thin);
    --shadow-soft: 0 1px 2px rgba(43, 30, 34, 0.06);
    --shadow-lift: 0 10px 30px rgba(43, 30, 34, 0.10);

    --container: 1220px;
    --header-h: 68px;
}

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

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--page);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 var(--sp-4);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }

p { margin: 0 0 var(--sp-4); max-width: 68ch; }

a { color: inherit; text-decoration-color: var(--ink-35); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

ul, ol { padding-left: 1.2em; }

small { font-size: var(--step--1); }

hr { border: 0; border-top: var(--border); margin: var(--sp-6) 0; }

:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection { background: var(--clay); color: var(--ink); }

/* Numbers line up in tables and price rows. */
.tabular, .price, td.num, .qty-value { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- layout --- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--sp-4);
}

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

.section { padding-block: var(--sp-7); }
.section-tight { padding-block: var(--sp-6); }

.band-paper  { background: var(--mist); }
.band-tint   { background: var(--paper); }
.band-sand   { background: var(--sand); }
.band-greige { background: var(--greige); }
.band-ink    { background: var(--ink); color: var(--on-dark); }
.band-ink a  { color: var(--on-dark); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

.muted { color: var(--ink-55); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------- announcement --- */

.announcement {
    background: var(--ink);
    color: var(--on-dark);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 9px var(--sp-4);
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-item { display: none; }
.announcement-item.is-visible { display: block; }

/* ------------------------------------------------------------ header --- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--ground);
    border-bottom: 1px solid rgba(31, 42, 38, 0.08);
}

.header-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    min-height: var(--header-h);
}

.wordmark {
    font-family: var(--font-display);
    font-size: var(--step-2);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.wordmark span { display: block; font-family: var(--font-body); font-size: 0.6rem; letter-spacing: 0.22em; color: var(--ink-55); margin-top: 3px; }

/* The Wear / Desk switch — a first-class control, not a dropdown. */
.dept-switch {
    display: inline-flex;
    background: var(--ink-06);
    border-radius: var(--radius-pill);
    padding: 3px;
}

.dept-switch a {
    display: block;
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--ink-70);
    transition: background 0.15s ease, color 0.15s ease;
}

.dept-switch a:hover { color: var(--ink); }

.dept-switch a.is-active {
    background: var(--ink);
    color: var(--on-dark);
}

.header-actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--ink);
    border-radius: var(--radius-pill);
    cursor: pointer;
    text-decoration: none;
}

.icon-btn:hover { background: var(--ink-06); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.icon-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--brass);
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.nav-main { display: flex; gap: var(--sp-5); }
.nav-main a { font-size: var(--step--1); font-weight: 500; text-decoration: none; padding-block: var(--sp-2); }
.nav-main a:hover { color: var(--brass); }

.menu-toggle { display: none; }

/* ------------------------------------------------------------ drawer --- */

.drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(31, 42, 38, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 86vw);
    background: var(--page);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    padding: var(--sp-5);
}

.drawer.is-open { transform: translateX(0); }
.drawer h4 { margin-bottom: var(--sp-2); color: var(--ink-55); font-size: var(--step--1); font-weight: 600; }
.drawer nav a { display: block; padding: var(--sp-2) 0; text-decoration: none; border-bottom: var(--border); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary { background: var(--ink); color: var(--on-dark); }
.btn-primary:hover { background: #16201c; }

.btn-accent { background: var(--brass); color: var(--ink); }
.btn-accent:hover { background: #96762a; }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink-35); }
.btn-outline:hover { border-color: var(--ink); background: var(--ink-06); }

.btn-quiet { background: transparent; color: var(--ink-70); padding-inline: var(--sp-3); }
.btn-quiet:hover { color: var(--ink); background: var(--ink-06); }

.btn-danger { background: var(--alert); color: var(--white); }

.btn-sm { padding: 8px 16px; font-size: var(--step--1); }
.btn-lg { padding: 15px 30px; font-size: var(--step-1); }
.btn-block { width: 100%; }

.btn:disabled, .btn.is-disabled { opacity: 0.45; cursor: not-allowed; }

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

.field { margin-bottom: var(--sp-4); }

.field label,
.label {
    display: block;
    font-size: var(--step--1);
    font-weight: 600;
    margin-bottom: var(--sp-2);
}

.input, .select, .textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: var(--step-0);
    color: var(--ink);
    background: var(--page);
    border: 1px solid var(--ink-12);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-35); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: 2px solid var(--brass); outline-offset: 1px; }
.textarea { min-height: 130px; resize: vertical; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231f2a26' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 38px;
}

.field-hint { font-size: var(--step--1); color: var(--ink-55); margin-top: var(--sp-2); }
.field-error { font-size: var(--step--1); color: var(--alert); margin-top: var(--sp-2); font-weight: 600; }
.input.has-error { border-color: var(--alert); }

.check { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--step--1); }
.check input { margin-top: 3px; accent-color: var(--ink); width: 17px; height: 17px; }

/* Honeypot — hidden from people, visible to bots. */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ink-12);
    border-radius: var(--radius-pill);
    background: var(--white);
    overflow: hidden;
}

.qty button {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    font-size: var(--step-1);
    color: var(--ink);
    cursor: pointer;
}

.qty button:hover { background: var(--ink-06); }
.qty-value { width: 44px; text-align: center; border: 0; background: transparent; font-size: var(--step-0); font-weight: 600; }

/* ------------------------------------------- the material chip (signature) */

/*
   This is the one element that should make the shop recognisable. It carries
   real data — the fabric for clothing, the paper for stationery — so it earns
   its place on every card rather than decorating it.
*/
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--step--1);
    line-height: 1.2;
    color: var(--ink-70);
}

.chip-swatch {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border-radius: 5px;
    border: 1px solid var(--ink-12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.chip-lg { font-size: var(--step-0); }
.chip-lg .chip-swatch { width: 20px; height: 20px; flex-basis: 20px; border-radius: 6px; }

.chip-label { color: var(--ink-35); }

/* -------------------------------------------------------------- badge --- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--ink-06);
    color: var(--ink-70);
}

.badge-sale    { background: var(--ink); color: var(--on-dark); }
.badge-new     { background: var(--ink); color: var(--on-dark); }
.badge-out     { background: var(--alert-10); color: var(--alert); }
.badge-low     { background: var(--brass-12); color: #6f5619; }
.badge-success { background: var(--success-10); color: var(--success); }

/* -------------------------------------------------------------- price --- */

.price { display: inline-flex; align-items: baseline; gap: var(--sp-2); font-weight: 700; }
.price-was { font-weight: 500; font-size: var(--step--1); color: var(--ink-35); text-decoration: line-through; }
.price-off { font-weight: 700; font-size: var(--step--1); color: var(--brass); }
.price-lg { font-size: var(--step-2); }

/* -------------------------------------------------------------- stars --- */

.stars { display: inline-flex; align-items: center; gap: 2px; }
.stars svg { width: 15px; height: 15px; }
.stars .on { fill: var(--brass); }
.stars .off { fill: var(--ink-12); }
.stars-count { font-size: var(--step--1); color: var(--ink-55); margin-left: var(--sp-2); }

/* --------------------------------------------------------------- card --- */

.card {
    background: var(--page);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-soft);
}

.card-white { background: var(--page); }
.card-tint  { background: var(--paper); border-color: transparent; }
.card-bordered { background: transparent; border: var(--border); }

.product-card { display: flex; flex-direction: column; }

.product-card-media {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--mist);
    border: 1px solid var(--hairline);
    aspect-ratio: 4 / 5;
}

.product-card-media { box-shadow: var(--shadow-soft); transition: box-shadow 0.2s ease; }
.product-card:hover .product-card-media { box-shadow: var(--shadow-lift); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }

.product-card-flags { position: absolute; top: var(--sp-3); left: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }

.product-card-wish {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    color: var(--ink);
}

.product-card-wish svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.product-card-wish.is-on svg { fill: var(--alert); stroke: var(--alert); }

.product-card-body { padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.product-card-title { font-family: var(--font-body); font-size: var(--step-0); font-weight: 600; line-height: 1.35; margin: 0; }
.product-card-title a { text-decoration: none; }
.product-card-title a:hover { color: var(--brass); }

/* --------------------------------------------------------- section head --- */

.section-head { margin-bottom: var(--sp-5); }
.section-head h2 { margin-bottom: var(--sp-2); }
.section-head p { color: var(--ink-55); margin: 0; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

/* --------------------------------------------------------- breadcrumbs --- */

.breadcrumbs { font-size: var(--step--1); color: var(--ink-55); padding-block: var(--sp-4); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs span { margin-inline: var(--sp-2); color: var(--ink-35); }

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

.notice {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--radius);
    border-left: 3px solid var(--ink-35);
    background: var(--ink-06);
    font-size: var(--step--1);
    margin-bottom: var(--sp-4);
}

.notice p:last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: 2px; }
.notice-success { background: var(--success-10); border-left-color: var(--success); }
.notice-warn    { background: var(--brass-12); border-left-color: var(--brass); }
.notice-error   { background: var(--alert-10); border-left-color: var(--alert); }

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

.empty {
    text-align: center;
    padding: var(--sp-8) var(--sp-4);
    border: 1px dashed var(--ink-12);
    border-radius: var(--radius-lg);
}

.empty h3 { margin-bottom: var(--sp-2); }
.empty p { margin-inline: auto; color: var(--ink-55); }

/* -------------------------------------------------------------- table --- */

.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th { text-align: left; font-weight: 600; padding: var(--sp-3); background: var(--sand); }
.table td { padding: var(--sp-3); border-bottom: var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: var(--border); }

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

.pagination { display: flex; gap: var(--sp-2); justify-content: center; padding: var(--sp-6) 0; flex-wrap: wrap; }

.pagination a, .pagination span {
    min-width: 40px;
    height: 40px;
    padding-inline: var(--sp-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: var(--step--1);
    font-weight: 600;
    border: 1px solid var(--ink-12);
}

.pagination a:hover { border-color: var(--ink); }
.pagination .is-current { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.pagination .is-disabled { opacity: 0.35; }

/* ------------------------------------------------------------- footer --- */

.site-footer { background: var(--ground); color: var(--ink); margin-top: var(--sp-9); padding-block: var(--sp-7) var(--sp-5); border-top: 1px solid rgba(31, 42, 38, 0.08); }
.site-footer a { color: var(--ink); text-decoration: none; opacity: 0.72; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--sp-6); }
.footer-grid h4 { color: var(--ink); font-size: var(--step--1); letter-spacing: 0.08em; opacity: 0.6; margin-bottom: var(--sp-3); }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); font-size: var(--step--1); }
.footer-bottom { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid rgba(31, 42, 38, 0.12); font-size: var(--step--1); opacity: 0.65; display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

/* -------------------------------------------------------------- toast --- */

.toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 80; display: grid; gap: var(--sp-2); }

.toast {
    background: var(--ink);
    color: var(--on-dark);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius);
    font-size: var(--step--1);
    box-shadow: var(--shadow-soft);
    max-width: 320px;
}

/* --------------------------------------------------------- responsive --- */

@media (max-width: 900px) {
    :root { --step-4: 2rem; --step-5: 2.4rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav-main { display: none; }
    .menu-toggle { display: inline-flex; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .section { padding-block: var(--sp-6); }
    .grid-products { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
    .dept-switch { display: none; }
    .wordmark { font-size: var(--step-1); }
    .toasts { left: var(--sp-4); right: var(--sp-4); }
    .toast { max-width: none; }
}

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