/* ==========================================================================
   DeskWorks — calm-productivity home-office & ergonomics.

   Ported from the Stitch "DeskWorks — Calm Productivity" design
   (docs/templates/pending/stitch_52_deskworks_e_commerce_homepage_storefront/
   …/DESIGN.md): a crisp grey-white (#f9f9f8) canvas, grounded slate-navy
   (#2f3e4e) structure, a single focus-green accent (#2f9e62), geometric
   Poppins (600) headlines over utilitarian Inter, soft 8px (0.5rem) corners
   and low-opacity ambient shadows — no heavy drop shadows. Depth comes from
   tonal layers and 1px borders.

   This theme OWNS its hero / featured / new-arrivals / categories /
   workspace-guide / newsletter home sections (dw-* markup) and INHERITS Modern
   Retail's functional pages, header, footer, trust, promo and journal
   partials. This stylesheet therefore has two jobs:

     (a) style the NEW `dw-*` markup into the Stitch design; and
     (b) restyle the INHERITED `mr-*` surfaces — chiefly by re-pointing the base
         neutral tokens at the DeskWorks palette, applying the 0.5rem radius,
         and recolouring the NAVY workspace-guide band + footer (where the base
         assumes dark-on-light).

   Everything is scoped under `body.dw-theme` and reads the 5 customizer tokens
   (--bs-primary, --bs-primary-rgb, --ll-accent, --ll-font-headings,
   --ll-font-body, --ll-btn-radius) with theme.json-default fallbacks, so the
   customizer + live preview keep working: change the primary colour and every
   slate surface follows.
   ========================================================================== */

body.dw-theme {
    /* Customizer-driven brand tokens (fallbacks match theme.json defaults) */
    --dw-slate: var(--bs-primary, #2f3e4e);
    --dw-slate-rgb: var(--bs-primary-rgb, 47, 62, 78);
    --dw-green: var(--ll-accent, #2f9e62);
    --dw-font-head: var(--ll-font-headings, "Poppins"), system-ui, sans-serif;
    --dw-font-body: var(--ll-font-body, "Inter"), system-ui, -apple-system, sans-serif;

    /* Calm-productivity palette (DESIGN.md). green-ink is the text-safe green
       (6.46:1 on white) for eyebrows / links / small green text; the raw
       accent green (#2f9e62, ~3.4:1) is reserved for fills and large / UI use. */
    --dw-green-ink: #006d3d;
    --dw-green-soft: #8df8b3;
    --dw-bg: #f9f9f8;
    --dw-white: #ffffff;
    --dw-surface-low: #f3f4f3;
    --dw-surface: #edeeed;
    --dw-surface-high: #e7e8e7;
    --dw-ink: #191c1c;
    --dw-muted: #44474c;
    --dw-soft: #74777c;
    --dw-line: #c4c6cc;
    --dw-navy: #2f3e4e;
    --dw-navy-deep: #192837;
    --dw-navy-light: #b8c8dc;
    --dw-on-navy: #99a9bc;

    /* Re-point the inherited base neutrals so every inherited mr-* surface
       (bands, borders, fills, muted text, radius, shadow) follows DeskWorks. */
    --mr-ink: var(--dw-ink);
    --mr-muted: var(--dw-muted);
    --mr-soft: var(--dw-soft);
    --mr-surface: var(--dw-white);
    --mr-band: var(--dw-surface-low);
    --mr-band-alt: var(--dw-surface);
    --mr-fill: var(--dw-surface-high);
    --mr-border: var(--dw-surface-high);
    --mr-border-strong: var(--dw-line);
    --mr-radius: 0.5rem;
    --mr-gold: #c0a04a;
    --mr-shadow: 0 4px 12px rgba(var(--dw-slate-rgb), 0.05);

    background-color: var(--dw-bg);
    color: var(--dw-ink);
    font-family: var(--dw-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Typography — geometric Poppins 600 headlines, focus-green tracked eyebrows.
   -------------------------------------------------------------------------- */
body.dw-theme h1, body.dw-theme h2, body.dw-theme h3,
body.dw-theme h4, body.dw-theme h5, body.dw-theme h6,
body.dw-theme .mr-display, body.dw-theme .mr-headline {
    font-family: var(--dw-font-head);
    color: var(--dw-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

body.dw-theme .mr-display { font-weight: 600; }

body.dw-theme .mr-eyebrow,
body.dw-theme .dw-eyebrow {
    font-family: var(--dw-font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dw-green-ink);
}

/* --------------------------------------------------------------------------
   Buttons — solid slate primary; slate-keyline ghost secondary. 0.5rem radius.
   -------------------------------------------------------------------------- */
body.dw-theme .mr-btn {
    border-radius: var(--ll-btn-radius, 0.5rem);
    font-weight: 600;
    letter-spacing: 0.06em;
}

body.dw-theme .mr-btn--primary {
    background: var(--dw-slate);
    border-color: var(--dw-slate);
    color: #fff;
}

body.dw-theme .mr-btn--primary:hover {
    background: var(--dw-navy-deep);
    border-color: var(--dw-navy-deep);
    filter: none;
    color: #fff;
}

body.dw-theme .mr-btn--outline,
body.dw-theme .dw-btn-outline,
body.dw-theme .dw-btn {
    border: 1px solid var(--dw-slate);
    color: var(--dw-slate);
    background: transparent;
}

body.dw-theme .dw-btn-outline:hover {
    background: var(--dw-surface-high);
    border-color: var(--dw-slate);
    color: var(--dw-slate);
}

body.dw-theme .mr-btn--outline:hover,
body.dw-theme .dw-btn:hover {
    background: var(--dw-slate);
    border-color: var(--dw-slate);
    color: #fff;
}

body.dw-theme .dw-btn-hero { padding: 0.9rem 2.25rem; }

/* Quiet keyline "View All Products" link */
body.dw-theme .dw-keyline-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--dw-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--dw-line);
    padding-bottom: 0.3rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

body.dw-theme .dw-keyline-link:hover {
    color: var(--dw-green-ink);
    border-color: var(--dw-green-ink);
}

/* --------------------------------------------------------------------------
   Inputs — white field, 1px line, slate focus (redraw the base blue ring).
   -------------------------------------------------------------------------- */
body.dw-theme .form-control,
body.dw-theme .form-select {
    background-color: var(--dw-white);
    border-color: var(--dw-line);
    border-radius: var(--ll-btn-radius, 0.5rem);
}

/* Keep Bootstrap's reserved caret gutter (never a padding shorthand here). */
body.dw-theme .form-select { padding-inline-end: 2.25rem; }

body.dw-theme .form-control:focus,
body.dw-theme .form-select:focus {
    border-color: var(--dw-slate);
    box-shadow: 0 0 0 3px rgba(var(--dw-slate-rgb), 0.16);
}

body.dw-theme .mr-search input:focus {
    box-shadow: 0 0 0 3px rgba(var(--dw-slate-rgb), 0.16);
}

/* --------------------------------------------------------------------------
   Announcement + header — slate announce band, white sticky header, geometric
   logo, focus-green active nav.
   -------------------------------------------------------------------------- */
body.dw-theme .mr-announce {
    background-color: var(--dw-navy);
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: none;
    font-weight: 500;
}

body.dw-theme .mr-logo {
    font-family: var(--dw-font-head);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dw-slate);
}

body.dw-theme .mr-nav-link:hover { color: var(--dw-green-ink); }
body.dw-theme .mr-nav-link.is-active {
    color: var(--dw-green-ink);
    border-bottom-color: var(--dw-green-ink);
    font-weight: 600;
}

body.dw-theme .mr-icon-btn { color: var(--dw-slate); }
body.dw-theme .mr-icon-btn:hover { color: var(--dw-green-ink); }
body.dw-theme .mr-badge--wish { background-color: var(--dw-green-ink); }

/* --------------------------------------------------------------------------
   Split hero — workspace photo left, copy right (stacks copy-first on mobile).
   -------------------------------------------------------------------------- */
body.dw-theme .dw-hero { padding-block: clamp(48px, 7vw, 80px); }

body.dw-theme .dw-hero__figure {
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 4 / 3.6;
    background: var(--dw-surface);
    box-shadow: var(--mr-shadow);
}

body.dw-theme .dw-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.dw-theme .dw-hero__eyebrow {
    color: var(--dw-green-ink);
    font-family: var(--dw-font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

body.dw-theme .dw-hero__title {
    font-family: var(--dw-font-head);
    font-weight: 600;
    color: var(--dw-slate);
    font-size: clamp(2.1rem, 4.2vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

body.dw-theme .dw-hero__lead {
    color: var(--dw-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 46ch;
    margin-bottom: 1.75rem;
}

body.dw-theme .dw-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* --------------------------------------------------------------------------
   Featured "Setup Staples" — white section band.
   -------------------------------------------------------------------------- */
body.dw-theme .dw-featured { background: var(--dw-white); }

/* New arrivals sit on the off-white canvas (transparent). */

/* --------------------------------------------------------------------------
   Product cards (inherited mr-card) — white bordered card, 24px pad, ambient
   shadow lift on hover.
   -------------------------------------------------------------------------- */
body.dw-theme .mr-card {
    background: var(--dw-white);
    border: 1px solid var(--mr-border);
    border-radius: var(--mr-radius);
    padding: 1.25rem;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

body.dw-theme .mr-card:hover {
    box-shadow: var(--mr-shadow);
    border-color: var(--dw-line);
}

body.dw-theme .mr-card__media { background: var(--dw-surface-low); }

body.dw-theme .mr-card__title { font-family: var(--dw-font-head); font-weight: 600; }
body.dw-theme .mr-card__title a:hover { color: var(--dw-green-ink); }
body.dw-theme .mr-card__price { color: var(--dw-slate); font-weight: 600; }

/* Sale badge — the export's green pill (darker green so white text passes AA) */
body.dw-theme .mr-card__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    background: var(--dw-green-ink);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: 0.25rem;
}

/* Overlay controls — restyle wish + quickview together, both states legible. */
body.dw-theme .mr-card__wish,
body.dw-theme .mr-card__quickview {
    background: rgba(255, 255, 255, 0.9);
    color: var(--dw-slate);
}

body.dw-theme .mr-card__wish:hover,
body.dw-theme .mr-card__quickview:hover {
    background: #fff;
    color: var(--dw-green-ink);
}

body.dw-theme .mr-card__wish.is-active { color: var(--dw-green-ink); }

body.dw-theme .mr-card__quick {
    background: var(--dw-slate);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Icon category tiles — white rounded cards, round surface well, slate icon.
   -------------------------------------------------------------------------- */
body.dw-theme .dw-cats { background: var(--dw-surface); }

body.dw-theme .dw-cat {
    background: var(--dw-white);
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-decoration: none;
    box-shadow: var(--mr-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dw-theme .dw-cat:hover { transform: translateY(-6px); }

body.dw-theme .dw-cat__well {
    width: 76px;
    height: 76px;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    background: var(--dw-surface-low);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

body.dw-theme .dw-cat:hover .dw-cat__well { background: var(--dw-green-soft); }

body.dw-theme .dw-cat__icon { width: 34px; height: 34px; color: var(--dw-slate); }

body.dw-theme .dw-cat__name {
    display: block;
    font-family: var(--dw-font-head);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--dw-slate);
}

/* --------------------------------------------------------------------------
   Workspace guide — the slate-navy "30-Minute Rule" band. Everything on it is
   light; the icons ride the light-green accent.
   -------------------------------------------------------------------------- */
body.dw-theme .dw-guide {
    background: var(--dw-navy);
    color: #fff;
    padding-block: clamp(56px, 8vw, 80px);
}

body.dw-theme .dw-guide__head { max-width: 60ch; margin-bottom: 3.5rem; }
body.dw-theme .dw-guide__title { color: #fff; font-size: clamp(1.75rem, 3vw, 2.25rem); }
body.dw-theme .dw-guide__intro { color: var(--dw-navy-light); font-size: 1.1rem; line-height: 1.6; }

body.dw-theme .dw-guide__card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
}

body.dw-theme .dw-guide__icon { width: 44px; height: 44px; color: var(--dw-green-soft); margin-bottom: 1.25rem; }
body.dw-theme .dw-guide__label { color: #fff; font-size: 1.15rem; margin-bottom: 0.6rem; }
body.dw-theme .dw-guide__text { color: var(--dw-navy-light); font-size: 0.95rem; line-height: 1.55; }

/* --------------------------------------------------------------------------
   Newsletter "Deep Work Digest" — light rounded surface panel with a faint
   mail watermark and a slate Subscribe button.
   -------------------------------------------------------------------------- */
body.dw-theme .dw-cta { padding-block: clamp(40px, 6vw, 64px); }

body.dw-theme .dw-cta__panel {
    position: relative;
    overflow: hidden;
    background: var(--dw-surface-high);
    border-radius: 1.25rem;
    padding: clamp(2rem, 5vw, 4rem);
}

body.dw-theme .dw-cta__watermark {
    position: absolute;
    top: -3rem;
    right: -3rem;
    width: 18rem;
    height: 18rem;
    color: var(--dw-slate);
    opacity: 0.08;
    pointer-events: none;
}

body.dw-theme .dw-cta__watermark svg { width: 100%; height: 100%; }

body.dw-theme .dw-cta__inner { position: relative; z-index: 1; max-width: 42rem; }
body.dw-theme .dw-cta__title { color: var(--dw-slate); }
body.dw-theme .dw-cta__body { color: var(--dw-muted); font-size: 1.05rem; }

body.dw-theme .dw-cta__form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 34rem;
}

body.dw-theme .dw-cta__form input {
    flex: 1 1 15rem;
    height: 3rem;
    padding: 0 1.25rem;
    background: var(--dw-white);
    border: 1px solid var(--dw-line);
    border-radius: var(--ll-btn-radius, 0.5rem);
    color: var(--dw-ink);
    font-size: 0.95rem;
}

body.dw-theme .dw-cta__form input:focus {
    outline: none;
    border-color: var(--dw-slate);
    box-shadow: 0 0 0 3px rgba(var(--dw-slate-rgb), 0.16);
}

body.dw-theme .dw-cta__btn { flex: 0 0 auto; padding-inline: 2.5rem; }
body.dw-theme .dw-cta__note { color: var(--dw-soft); font-size: 0.78rem; }

/* --------------------------------------------------------------------------
   Inherited trust strip + promo + journal finishing.
   -------------------------------------------------------------------------- */
body.dw-theme .mr-trust svg { color: var(--dw-green-ink); }
body.dw-theme .mr-promo { border-radius: 0.75rem; }

/* Journal heading keeps its inherited layout; the eyebrow follows the green
   ink via the .mr-eyebrow rule above. */

/* --------------------------------------------------------------------------
   Footer — the export's slate-navy footer. The base assumes a light footer, so
   recolour every text/icon role and INVERT the primary "Join" button (a slate
   fill on a slate band is invisible — the indigo-works trap).
   -------------------------------------------------------------------------- */
body.dw-theme .mr-footer {
    background: var(--dw-navy);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

body.dw-theme .mr-footer h4 { color: var(--dw-navy-light); }
body.dw-theme .mr-footer__brand { color: var(--dw-navy-light); font-family: var(--dw-font-head); }
body.dw-theme .mr-footer a { color: var(--dw-on-navy); }
body.dw-theme .mr-footer a:hover { color: #fff; }
body.dw-theme .mr-footer .mr-muted { color: var(--dw-on-navy); }
body.dw-theme .mr-footer .mr-soft { color: rgba(255, 255, 255, 0.5); }
body.dw-theme .mr-footer .mr-divider { background-color: rgba(255, 255, 255, 0.12); }

body.dw-theme .mr-footer .mr-social {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
}

body.dw-theme .mr-footer .mr-social:hover {
    background: #fff;
    border-color: #fff;
    color: var(--dw-navy);
}

/* The footer newsletter input keeps its white field; invert the Join button. */
body.dw-theme .mr-footer .mr-btn--primary {
    background: #fff;
    border-color: #fff;
    color: var(--dw-navy);
}

body.dw-theme .mr-footer .mr-btn--primary:hover {
    background: var(--dw-green-ink);
    border-color: var(--dw-green-ink);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Reduced motion — kill the decorative lifts / scales.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    body.dw-theme .mr-btn,
    body.dw-theme .mr-card,
    body.dw-theme .dw-cat,
    body.dw-theme .dw-cat__well {
        transition: none;
    }
    body.dw-theme .dw-cat:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Mobile (from the Stitch mobile frames): tighter hero, single-column guide.
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    body.dw-theme .dw-hero__figure { aspect-ratio: 16 / 11; }
    body.dw-theme .dw-hero__lead { font-size: 1rem; }
    body.dw-theme .dw-guide__head { margin-bottom: 2.5rem; }
    body.dw-theme .dw-cta__panel { padding: 1.75rem; }
}
