/* ============================================================
   UNI.ART — main.css
   Desktop/base styles only. ALL @media queries live in
   responsive.css per Rule 11. Includes prefers-reduced-motion
   + @media print over there as well.
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ── Design tokens (Rule 6, 7, 8, 9) ───────────────────────── */
:root {
    /* Rule 6 — color tokens */
    --primary-color:   #1a1a1a;
    --secondary-color: #e8e4df;
    --accent-color:    #1a1a1a;
    --text-color:      #1a1a1a;
    --bg-color:        #ffffff;
    --border-color:    rgba(0, 0, 0, 0.08);

    /* Legacy aliases (prototype names) */
    --bg:   var(--bg-color);
    --text: var(--text-color);

    /* Rule 7 — typography tokens */
    --font-body: 'IBM Plex Mono', monospace;
    --font:      var(--font-body);
    --h1-size:   clamp(2rem, 4.5vw, 3.5rem);
    --h2-size:   clamp(1.5rem, 3vw, 2.25rem);
    --h3-size:   clamp(1.2rem, 2vw, 1.6rem);
    --fs-ui:     1rem;
    --fs-info:   0.8rem;

    /* Rule 8 — section padding */
    --section-padding: clamp(40px, 5vw, 80px);

    /* Rule 9 — container + spacing */
    --container-max-width: 1440px;
    --container-padding:   clamp(16px, 3vw, 32px);
    --gap-sm: 4px;
    --gap-md: 8px;
    --gap-lg: 16px;
    --gap-xl: 32px;

    /* Prototype legacy */
    --gap:        4px;
    --nav-height: 52px;
}

html {
    font-size: clamp(10px, 1.5vw, 13px);
}

html,
body {
    height: 100%;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0.03em;
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
}

/* ── Main wrapper — propagates the body's flex chain ──────── */
/* WordPress wraps page content in <main class="site-main">. The prototype
   had the gallery as a direct child of <body>, so its `flex: 1` worked
   directly. Inside <main>, the flex chain breaks unless <main> itself
   becomes a flex column. We do that ONLY when main contains a gallery
   (front-page, archive); other pages (single product, simple page, artist
   page) keep natural flow with content sizing themselves. */
.site-main {
    flex: 1;
    min-height: 0;
}
.site-main:has(> .sart-columns),
.site-main:has(> .gallery-empty),
body.saved-items-page .site-main,
body.home .site-main,
body.archive .site-main,
body.woocommerce-shop .site-main,
body.post-type-archive-product .site-main,
body.tax-university .site-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* ── Layout: multi-column gallery ──────────────────────────── */
/* NOTE: classes are namespaced (.sart-columns / .sart-col) on purpose.
   The original prototype used the bare names `.columns` / `.col`, which are
   among the most collision-prone class names in CSS — WooCommerce, WCFM,
   and most CSS frameworks ship rules on them. A clashing site-wide rule
   (WCFM loads its stylesheet on every page) would clobber this flexbox
   layout and make the tiles collapse/hide while the rest of the chrome
   stayed visible. Namespacing eliminates that entire class of conflict.
   The !important on the structural display properties is belt-and-suspenders
   against any future clash. */
.sart-columns {
    display: flex;
    flex: 1;
    gap: var(--gap);
    padding: var(--gap);
    overflow: hidden;
    min-height: 0;
    transition: opacity 0.6s ease;
}

.sart-columns.fading { opacity: 0; }

/* ── Empty state (WC active, no products yet) ──────────────── */
.gallery-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-padding) var(--container-padding);
    text-align: center;
}
.gallery-empty__inner { max-width: 30rem; }
.gallery-empty__headline {
    font-family: var(--font);
    font-size: var(--h3-size);
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: var(--gap-md);
}
.gallery-empty__hint {
    font-size: var(--fs-info);
    line-height: 1.6;
    opacity: 0.6;
    margin-bottom: var(--gap-sm);
}
.gallery-empty__link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.gallery-empty__link:hover { opacity: 0.6; }

.sart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
    transition: flex 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.7s ease,
                margin 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.sart-col::-webkit-scrollbar { display: none; }

.sart-col.col-entering,
.sart-col.col-exiting {
    flex: 0.001;
    opacity: 0;
    margin-left: calc(var(--gap) * -1);
    overflow: hidden;
}

/* ── Tile ──────────────────────────────────────────────────── */
.grid-item {
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #e8e8e8;
}

/* Subtle skeleton shimmer while the tile image is still loading. The image
   (opacity 0 to 1) fades in over this; .img-loaded on the parent stops it.
   Disabled automatically under prefers-reduced-motion (global reduce rule). */
.grid-item:not(.img-loaded) .img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 70%);
    transform: translateX(-100%);
    animation: sart-shimmer 1.5s ease-in-out infinite;
    pointer-events: none;
}
.grid-item.img-loaded .img-wrap { background-color: transparent; }

body.artist-mode .img-wrap { background-color: #242424; }
body.artist-mode .grid-item.img-loaded .img-wrap { background-color: transparent; }
body.artist-mode .grid-item:not(.img-loaded) .img-wrap::after {
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0) 70%);
}

@keyframes sart-shimmer {
    100% { transform: translateX(100%); }
}

.grid-item .tile-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: #e8e8e8;
    transition: opacity 1.2s ease;
}

.grid-item .tile-img.loading { opacity: 0; }
.grid-item .tile-img.loaded  { opacity: 1; }

.grid-item .tile-img-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
    pointer-events: none;
}

.grid-item.expanded .tile-img-bg { opacity: 1; }
.grid-item.expanded .tile-img    { opacity: 0; }

/* When a tile has no BG image variant (.tile--no-bg, set in PHP/JS for
   artworks where the bg field is empty), keep the MAIN image visible on
   .expanded — otherwise the image fades to 0 and there's nothing to take
   its place, making the tile appear to "disappear" on click. */
.grid-item.tile--no-bg.expanded .tile-img { opacity: 1; }

/* ── Tile info panel ───────────────────────────────────────── */
.tile-info {
    display: grid;
    grid-template-rows: 0fr;
    background: var(--bg);
    /* Border is transparent until the tile's image has actually loaded.
       Otherwise, while images are still fetching, the only visible thing
       in each tile is this 1px line — and stacked across 22 tiles those
       lines pile up at the top of the page. JS adds .img-loaded to the
       parent .grid-item when its <img> completes (or is cache-hit). */
    border-top: 1px solid transparent;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-top-color 0.3s ease;
    font-size: var(--fs-info);
    line-height: 1.2;
    color: var(--text);
}

.grid-item.img-loaded .tile-info { border-top-color: var(--border-color); }

.tile-info-inner {
    overflow: hidden;
    padding: 0 10px;
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-item.expanded .tile-info { grid-template-rows: 1fr; }
.grid-item.expanded .tile-info-inner { padding: 10px 10px 12px; }

.tile-info-name    { margin-bottom: 2px; }
.tile-info-title   { margin-bottom: 2px; }
.tile-info-medium  { margin-bottom: 2px; }
.tile-info-uni     { margin-bottom: 2px; }

.tile-info-price .price-dim { opacity: 0.2; }

.tile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 8px;
}

.tile-info-actions {
    display: flex;
    gap: 12px;
}

.tile-info-actions span {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.tile-info-actions span:hover { opacity: 1; }

/* ── Staff pick badge ─────────────────────────────────────── */
.badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--text);
    color: var(--bg);
    font-size: 0.7rem;
    line-height: 1;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}

/* ── Bottom nav ───────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 16px;
    z-index: 400;
    border-top: 1px solid var(--border-color);
}

.bottom-nav span {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 0.03em;
    cursor: pointer;
    padding: 8px 4px;
    user-select: none;
}

/* ── Scroll-mode toggle ───────────────────────────────────── */
.scroll-toggle-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 200;
    pointer-events: none;
}

.scroll-toggle {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 4px 14px 5px;
    font-size: var(--fs-info);
    letter-spacing: 0.06em;
    border: 1px solid var(--border-color);
    border-top: none;
    user-select: none;
}

.st-opt { cursor: pointer; opacity: 0.3; transition: opacity 0.15s; }
.st-opt.active { opacity: 1; }
.st-divider { opacity: 0.25; }

/* ── Panel backdrop ───────────────────────────────────────── */
.panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 340;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.panel-backdrop.open { opacity: 1; pointer-events: all; }

/* ── Filter panel ─────────────────────────────────────────── */
.filter-panel {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 350;
    background: var(--bg);
    border-top: 1px solid var(--border-color);
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.filter-panel::-webkit-scrollbar { display: none; }
.filter-panel.open { transform: translateY(0); pointer-events: all; }

.filter-header {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    width: 100%;
    opacity: 0.35;
    transition: opacity 0.15s;
}
.filter-header:hover,
.filter-header.open { opacity: 1; }

.more-filters {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.more-filters.open { grid-template-rows: 1fr; }
.more-filters-inner { overflow: hidden; }

.more-filter-item {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    display: block;
    width: 100%;
    text-align: left;
    transition: opacity 0.15s;
    opacity: 1;
}
.more-filter-item:last-child { border-bottom: none; }
.more-filter-item:hover { opacity: 0.35; }

.filter-uni {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    width: 100%;
    transition: opacity 0.15s;
    opacity: 1;
}
.filter-uni-abbr { text-align: left; }
.filter-uni-name { text-align: right; }
.filter-uni:last-child { border-bottom: none; }
.filter-uni:hover,
.filter-uni.active { opacity: 0.35; }

.bottom-nav .filter-btn.open { opacity: 0.4; }

.filter-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}

.filter-close {
    font-family: var(--font);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 8px 0;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, max-width 0.35s ease, padding 0.35s ease;
    user-select: none;
}
.filter-wrap.has-filter .filter-close {
    opacity: 0.45;
    max-width: 20px;
    padding-left: 6px;
}
.filter-wrap.has-filter .filter-close:hover { opacity: 1; }

/* ── Active filter chip ───────────────────────────────────── */
.active-filter-bar {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 350;
    background: var(--bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s ease;
}
.active-filter-bar.visible { height: 38px; opacity: 1; }

.active-filter-bar .af-label {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.active-filter-bar .af-close {
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s;
    margin-left: 12px;
    flex-shrink: 0;
}
.active-filter-bar .af-close:hover { opacity: 1; }

/* ── Menu panel ───────────────────────────────────────────── */
.menu-panel {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 350;
    background: var(--bg);
    border-top: 1px solid var(--border-color);
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.menu-panel::-webkit-scrollbar { display: none; }
.menu-panel.open { transform: translateY(0); pointer-events: all; }

.menu-list { display: none; }
body:not(.artist-mode) .menu-list--collector { display: block; }
body.artist-mode .menu-list--artist          { display: block; }

.menu-item,
.menu-item-header {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    display: block;
    width: 100%;
    text-align: left;
    transition: opacity 0.15s;
    text-decoration: none;
}
.menu-item:hover,
.menu-item-header:hover { opacity: 0.35; }
.menu-item-header.open  { opacity: 1; }
.menu-item-header {
    display: flex;
    justify-content: space-between;
}

.menu-sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.menu-sub.open { grid-template-rows: 1fr; }
.menu-sub-inner { overflow: hidden; }

.menu-sub-item {
    font-family: var(--font);
    font-size: var(--fs-info);
    line-height: 1.3;
    letter-spacing: 0.03em;
    padding: 10px 16px 10px 28px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    transition: opacity 0.15s;
}
.menu-sub-item:last-child { border-bottom: none; }
.menu-sub-item:hover { opacity: 0.35; }
.menu-sub-item .sub-label .sub-title { font-style: italic; }
.menu-sub-item .sub-detail { opacity: 0.4; text-align: right; }

.menu-switch {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    border: none;
    background: var(--text);
    color: var(--bg);
    cursor: pointer;
    user-select: none;
    display: block;
    width: 100%;
    text-align: left;
    transition: opacity 0.15s;
}
.menu-switch:hover { opacity: 0.75; }

.bottom-nav .menu-btn.open { opacity: 0.4; }

/* ── Artist mode (dark theme) ─────────────────────────────── */
body.artist-mode {
    --bg-color:   #1a1a1a;
    --text-color: #e8e4df;
    --bg:   var(--bg-color);
    --text: var(--text-color);
}

body.artist-mode .tile-info,
body.artist-mode .filter-header,
body.artist-mode .filter-uni,
body.artist-mode .more-filter-item,
body.artist-mode .menu-item,
body.artist-mode .menu-item-header { color: var(--text); }

body.artist-mode .grid-item .tile-img { background: #2a2a2a; }
body.artist-mode .menu-switch { background: var(--text); color: var(--bg); }

body.artist-mode .filter-panel,
body.artist-mode .menu-panel,
body.artist-mode .bottom-nav,
body.artist-mode .active-filter-bar,
body.artist-mode .scroll-toggle { border-color: rgba(255, 255, 255, 0.1); }

body.artist-mode .filter-header,
body.artist-mode .filter-uni,
body.artist-mode .more-filter-item,
body.artist-mode .more-filters,
body.artist-mode .menu-item,
body.artist-mode .menu-item-header,
body.artist-mode .menu-sub,
body.artist-mode .menu-sub-item,
body.artist-mode .tile-info { border-color: rgba(255, 255, 255, 0.08); }

/* ── Login modal ──────────────────────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.login-overlay.visible { opacity: 1; pointer-events: all; }

.login-box {
    background: var(--bg);
    padding: 28px 24px;
    width: 320px;
    max-width: 90vw;
    position: relative;
    border-radius: 2px;
}

.login-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
}
.login-close:hover { opacity: 1; }

.login-box h2 {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
}

.login-field {
    display: block;
    width: 100%;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    color: var(--text);
    outline: none;
    margin-bottom: 16px;
}
.login-field::placeholder { color: var(--text); opacity: 0.35; }

.login-submit {
    display: block;
    width: 100%;
    font-family: var(--font);
    font-size: 1rem;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    border: none;
    background: var(--text);
    color: var(--bg);
    cursor: pointer;
    margin-top: 8px;
    border-radius: 2px;
    transition: opacity 0.15s;
}
.login-submit:hover { opacity: 0.8; }

body.artist-mode .login-field { border-bottom-color: rgba(255, 255, 255, 0.15); }

/* uniart-pass-toggle: monochrome show/hide, mobile-first */
.uniart-pass-wrap { position: relative; display: block; margin-bottom: 16px; }
.uniart-pass-wrap > .login-field { margin-bottom: 0; padding-right: 44px; }
.uniart-pass-toggle {
    position: absolute; top: 50%; right: 0; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: flex-end;
    width: 44px; height: 44px; padding: 0 6px 0 0; margin: 0;
    border: none; background: none; color: var(--text);
    opacity: 0.4; cursor: pointer; transition: opacity 0.15s;
    -webkit-appearance: none; appearance: none;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    -webkit-user-select: none; user-select: none;
}
.uniart-pass-toggle:hover, .uniart-pass-toggle:focus-visible, .uniart-pass-toggle:active { opacity: 1; }
.uniart-pass-toggle svg { display: block; width: 20px; height: 20px; pointer-events: none; }
.uniart-pass-toggle .pp-slash { opacity: 0; }
.uniart-pass-toggle.is-revealed .pp-slash { opacity: 1; }
@media (max-width: 767px) { input.login-field { font-size: 16px; } } /* uniart-ios-nozoom */

/* ── Detail page (overlay + single-product) ──────────────── */
.detail-page {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.detail-page::-webkit-scrollbar { display: none; }
.detail-page.open { opacity: 1; pointer-events: all; }

/* When rendered as a real page (woocommerce/single-product.php), it is
   always "open" — no overlay-style animation, just visible. */
.detail-page--single { position: static; opacity: 1; pointer-events: all; }

.detail-page.animating .detail-info-wrap,
.detail-page.animating .detail-back { opacity: 0; }

.detail-page .detail-info-wrap,
.detail-page .detail-back { transition: opacity 0.3s ease 0.15s; }

.detail-back {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 310;
    font-family: var(--font);
    font-size: 15px;
    letter-spacing: 0.03em;
    color: var(--text);
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
    text-decoration: none;
}
.detail-back:hover { opacity: 0.5; }

.detail-page--single .detail-back { position: absolute; }

.detail-layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - var(--nav-height));
}

.detail-col-left {
    width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.detail-info-wrap {
    display: flex;
    flex-direction: column;
    width: 50%;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    scrollbar-width: none;
    font-family: var(--font);
    font-size: var(--fs-info);
    line-height: 1.45;
    letter-spacing: 0.03em;
    color: var(--text);
}
.detail-info-wrap::-webkit-scrollbar { display: none; }

.detail-info-top { display: flex; flex: 1; }

.detail-col-info-a,
.detail-col-info-b {
    flex: 1;
    min-width: 0;
    padding: 28px 24px 0;
}

.detail-info-bottom {
    display: flex;
    padding-top: 100px;
}

.detail-bottom-a,
.detail-bottom-b {
    flex: 1;
    min-width: 0;
    padding: 0 24px 40px;
}

.detail-img-wrap {
    position: relative;
    width: 100%;
    background: #e8e8e8;
}
body.artist-mode .detail-img-wrap { background: #2a2a2a; }

.detail-img-wrap img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.detail-carousel-dots { display: none; }
.detail-gallery-wrap { display: contents; }

.detail-muted { margin-bottom: 3px; opacity: 0.5; }
.detail-bio   { line-height: 1.5; opacity: 0.7; }
.detail-link-inline { display: inline; opacity: 1; }

.detail-line       { margin-bottom: 3px; }
.detail-line-title { margin-bottom: 3px; }
.detail-line-title .dt-italic { font-style: italic; }
.detail-spacer    { height: 12px; }

/* WC's get_price_html() output — neutralize WC default tag styling and
   re-apply the prototype's text treatment. Handles sale-price rendering
   (regular price gets <del>, sale price gets <ins>). */
.detail-price { margin-bottom: 3px; }
.detail-price .woocommerce-Price-amount,
.detail-price .amount,
.detail-price bdi { font-family: var(--font); color: inherit; text-decoration: inherit; }
.detail-price del {
    opacity: 0.45;
    text-decoration: line-through;
    margin-right: 8px;
}
.detail-price ins {
    text-decoration: none;
    background: transparent;
}
.detail-price .woocommerce-Price-currencySymbol {
    margin-left: 0.1em;
}

.detail-link {
    color: inherit;
    margin-bottom: 3px;
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.15s;
}
.detail-link:hover { opacity: 0.5; }

/* ── Add-to-Cart CTA ─────────────────────────────────────── */
/* Clearly present commercial action — bordered rectangle, uppercase
   monospace, hover inverts background↔text (same DNA as .menu-switch),
   and an arrow → that nudges right on hover for a small affordance.
   Still minimal: no rounded corners, no shadow, no gradient — just a
   1px border in the active text color. Matches the design system.

   Sold-out variant uses the same shape but dimmed and non-interactive
   (rendered as <span>, not <a>). View-cart link from WC's AJAX flow
   ("added_to_cart" class) gets a quieter underlined treatment so the
   primary CTA still dominates after a successful add. */
.detail-cta-row {
    margin-top: 12px;
    margin-bottom: 8px;
}

.detail-cta-add {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font);
    font-size: 0.95rem;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--text);
    padding: 12px 22px;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.25s ease,
                color 0.25s ease,
                letter-spacing 0.25s ease,
                border-color 0.25s ease;
}
.detail-cta-add:hover,
.detail-cta-add:focus-visible {
    background: var(--text);
    color: var(--bg);
    letter-spacing: 0.16em;
    outline: none;
}
.detail-cta-add:active { opacity: 0.85; }

.detail-cta-arrow {
    display: inline-block;
    line-height: 1;
    transition: transform 0.25s ease;
}
.detail-cta-add:hover .detail-cta-arrow,
.detail-cta-add:focus-visible .detail-cta-arrow {
    transform: translateX(3px);
}

/* WC AJAX add-to-cart states — applied by WC's frontend script. */
.detail-cta-add.added   { opacity: 0.55; pointer-events: none; }
.detail-cta-add.loading { opacity: 0.7;  pointer-events: none; }

/* WC's auto-appended "View Cart" link after successful AJAX add. */
.added_to_cart {
    display: inline-block;
    margin-left: 14px;
    padding: 12px 0;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.06em;
    color: var(--text);
    opacity: 0.55;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.15s;
}
.added_to_cart:hover { opacity: 1; }

.detail-cta-add--soldout {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--text);
}
.detail-cta-add--soldout:hover,
.detail-cta-add--soldout:focus-visible {
    background: transparent;
    color: var(--text);
    letter-spacing: 0.12em;
}

body.artist-mode .detail-cta-add { border-color: var(--text); }
body.artist-mode .detail-cta-add:hover { background: var(--text); color: var(--bg); }

.detail-desc {
    margin-top: 4px;
    line-height: 1.5;
    opacity: 0.7;
}

.detail-related-label {
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    padding: 40px var(--gap) 12px;
}

.detail-grid {
    display: flex;
    gap: var(--gap);
    padding: var(--gap);
}

.detail-grid-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
}

.detail-grid .grid-item { width: 100%; }

/* Unified scroll-mode (all columns scroll together) */
.sart-columns.unified {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.sart-columns.unified::-webkit-scrollbar { display: none; }
.sart-columns.unified .sart-col { overflow: visible; }

/* ── Artist page ─────────────────────────────────────────── */
.artist { padding-bottom: var(--section-padding); }

.artist__hero {
    width: 100%;
    margin-bottom: var(--gap-lg);
}
.artist__hero-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.artist__meta {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--gap-xl) var(--container-padding);
}

.artist__name {
    font-family: var(--font);
    font-size: var(--h2-size);
    font-weight: 400;
    margin-bottom: var(--gap-md);
}

.artist__born,
.artist__klasse {
    font-size: var(--fs-info);
    opacity: 0.7;
    margin-bottom: var(--gap-sm);
}

.artist__bio {
    margin-top: var(--gap-lg);
    line-height: 1.6;
    opacity: 0.9;
}

.artist__works-heading {
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    padding: var(--gap-xl) var(--gap) var(--gap-md);
}

.gallery--artist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--gap);
    padding: var(--gap);
}

/* ── Page content fallback ───────────────────────────────── */
.page-content,
.default-content {
    padding: var(--section-padding) 0;
}
.page-title {
    font-family: var(--font);
    font-size: var(--h1-size);
    font-weight: 400;
    margin-bottom: var(--gap-lg);
}
.entry-content {
    line-height: 1.6;
    max-width: 70ch;
}

/* -- Auth overlay: login / registration toggle -- */
.login-box { transition: opacity 0.18s ease; }
.login-box.auth-switching { opacity: 0; }

.auth-view { animation: sartAuthIn 0.28s ease; }
@keyframes sartAuthIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-view--register { display: none; }
.login-box.show-register .auth-view--login { display: none; }
.login-box.show-register .auth-view--register { display: block; }

.auth-msg {
    display: none;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    line-height: 1.4;
    color: #c0392b;
    margin-bottom: 14px;
}
.auth-msg.show { display: block; }
.auth-msg.ok { color: var(--text); opacity: 0.6; }

.auth-forgot {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.45;
    text-decoration: none;
    transition: opacity 0.15s;
}
.auth-forgot:hover { opacity: 0.9; }

.auth-switch {
    margin-top: 18px;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.6;
}
.auth-switch-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.auth-switch-btn:hover { opacity: 0.7; }

.auth-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Auth: resend link + email-confirmation banner */
.auth-resend {
    display: none;
    margin-top: 10px;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: var(--fs-info);
    text-decoration: underline;
    cursor: pointer;
    color: var(--text);
    opacity: .5;
}
.auth-resend.show { display: inline-block; }
.auth-resend:hover { opacity: .85; }

.sart-confirm-banner {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 90%;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: var(--fs-info);
    line-height: 1.3;
    text-align: center;
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 6px 28px rgba(0,0,0,.18);
    transition: opacity .5s ease;
}
.sart-confirm-banner.err { background: #c0392b; color: #fff; }
.sart-confirm-banner.fade-out { opacity: 0; pointer-events: none; }
/* ── Saved Items (collector wishlist) ──────────────────────────────── */
.tile-info-actions .action-save.is-saved {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.tile-info-actions .action-save.is-busy {
    opacity: 0.3;
    pointer-events: none;
}
.saved-items-page .grid-item.removing {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.saved-items-page .sart-columns[hidden],
.saved-empty[hidden] { display: none !important; }
.saved-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    min-height: 0;
    padding: 48px 24px;
    animation: sart-saved-fade 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.saved-empty__headline {
    font-size: var(--fs-info, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.85;
}
.saved-empty__hint {
    margin-top: 12px;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--text);
    opacity: 0.45;
}
@keyframes sart-saved-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
/* ── Detail-view "Save to collection" toggle ───────────────── */
.detail-save-row {
    margin-top: 12px;
    margin-bottom: 4px;
}
.action-save.detail-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.55;
    transition: opacity 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}
.action-save.detail-save::before {
    content: "\2661"; /* heart outline */
    font-size: 1.2em;
    line-height: 1;
    transform: translateY(0.5px);
}
.action-save.detail-save:hover { opacity: 1; }
.action-save.detail-save.is-saved { opacity: 1; }
.action-save.detail-save.is-saved::before { content: "\2665"; }
.action-save.detail-save.is-busy { opacity: 0.35; pointer-events: none; }
/* -----------------------------------------------------------------------------
   UNI.ART - Two-step auth (login + registration) + role choice
   Email step -> password step, with animated height + cross-fade. Works in both
   the light "collector" theme and body.artist-mode (dark) via CSS variables.
   ----------------------------------------------------------------------------- */

/* Let a tall registration step scroll inside the box on short screens. */
.login-box { max-height: 90vh; overflow-y: auto; scrollbar-width: none; }
.login-box::-webkit-scrollbar { display: none; }

/* Step container animates its height between steps; clips during the move. */
.auth-steps {
    position: relative;
    overflow: hidden;
    transition: height 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Steps are stacked; only the active one is in flow + visible. */
.auth-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.24s ease;
    pointer-events: none;
}
.auth-step.is-active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}

/* Intro + helper copy */
.auth-intro {
    font-family: var(--font);
    font-size: var(--fs-info);
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.7;
    margin-bottom: 16px;
}
.auth-pass-label,
.auth-roles-label {
    display: block;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.65;
    margin-bottom: 8px;
}
.auth-hint {
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.45;
    margin: -6px 0 6px;
}
.auth-terms {
    font-family: var(--font);
    font-size: var(--fs-info);
    line-height: 1.45;
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.45;
    margin-top: 16px;
}
.auth-step-context {
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.6;
    margin-bottom: 14px;
    word-break: break-all;
}

/* Back link on the password step */
.auth-back {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 16px;
    font-family: var(--font);
    font-size: var(--fs-info);
    letter-spacing: 0.03em;
    color: var(--text);
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.15s;
}
.auth-back:hover { opacity: 0.95; }

/* Role choice */
.auth-roles { margin-bottom: 16px; }
.auth-role {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.auth-role:hover { border-color: rgba(0, 0, 0, 0.4); }
.auth-role.is-selected { border-color: var(--text); background: rgba(0, 0, 0, 0.04); }
.auth-role-title {
    display: block;
    font-size: var(--fs-ui);
    letter-spacing: 0.03em;
    margin-bottom: 3px;
}
.auth-role-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border: 1px solid currentColor;
    border-radius: 50%;
    vertical-align: middle;
    opacity: 0.5;
    transition: background 0.15s, opacity 0.15s;
}
.auth-role.is-selected .auth-role-title::before { background: currentColor; opacity: 1; }
.auth-role-desc {
    display: block;
    font-size: var(--fs-info);
    line-height: 1.45;
    letter-spacing: 0.03em;
    opacity: 0.6;
}

/* Dark (artist) theme variants for the bordered role cards */
body.artist-mode .auth-role { border-color: rgba(255, 255, 255, 0.18); }
body.artist-mode .auth-role:hover { border-color: rgba(255, 255, 255, 0.45); }
body.artist-mode .auth-role.is-selected { border-color: var(--text); background: rgba(255, 255, 255, 0.06); }

@media (prefers-reduced-motion: reduce) {
    .auth-steps, .auth-step { transition: none; }
    .auth-step { transform: none; }
}

/* ===================================================================
   Product CTA cluster harmonization (added)
   ADD TO CART and VIEW ON YOUR WALL share ONE full-width button style;
   SAVE and View cart share one quiet secondary-link row.
   (.detail-page .arview-trigger out-specificities arview.css's base.)   */
.detail-cta-add,
.detail-page .arview-trigger {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font);
    font-size: 0.8rem;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--text);
    padding: 14px 18px;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.25s ease, color 0.25s ease, letter-spacing 0.25s ease, border-color 0.25s ease;
}
.detail-cta-add:hover,
.detail-cta-add:focus-visible,
.detail-page .arview-trigger:hover,
.detail-page .arview-trigger:focus-visible {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    letter-spacing: 0.18em;
    outline: none;
}
.detail-page .arview-trigger .arview-ico { order: 2; }
.detail-cta-add--soldout,
.detail-cta-add--soldout:hover,
.detail-cta-add--soldout:focus-visible {
    background: transparent;
    color: var(--text);
    opacity: 0.4;
    cursor: not-allowed;
    letter-spacing: 0.16em;
}
/* stack: cart button, AR button just below it */
.detail-cta-row { margin: 18px 0 0; }
.detail-page .arview-trigger { margin: 8px 0 0; }
/* secondary links on one quiet row */
.detail-save-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    margin: 18px 0 4px;
}
.detail-save,
.action-save.detail-save {
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    opacity: 0.55;
}

/* AR slot wrapper is layout-transparent: now that the trigger is rendered
   inline server-side, it should lay out as a direct cluster child (full-width,
   no pop-in). Degrades gracefully where display:contents is unsupported. */
.detail-page .arview { display: contents; }

/* ---- Post-add conversion treatment (peak-intent CTA) ----
   The instant a buyer adds to cart, "View cart" becomes the STRONGEST action
   (solid fill) right where the cursor already is, and the now-done
   Add-to-cart button drops to a quiet confirmation. Scoped to the product
   cluster, so it applies on the single page AND inside the gallery overlay. */
.detail-col-info-a .added_to_cart {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 0;
    padding: 14px 18px;
    font-family: var(--font);
    font-size: 0.8rem;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--text);
    border: 1px solid var(--text);
    text-decoration: none;
    opacity: 1;
    transition: opacity 0.2s ease, letter-spacing 0.25s ease;
}
.detail-col-info-a .added_to_cart::after { content: '\2192'; order: 2; }
.detail-col-info-a .added_to_cart:hover,
.detail-col-info-a .added_to_cart:focus-visible {
    opacity: 0.85;
    letter-spacing: 0.18em;
    text-decoration: none;
    outline: none;
}
.detail-cta-add.added,
.detail-cta-add.added:hover,
.detail-cta-add.added:focus-visible,
.detail-cta-add.is-confirmed,
.detail-cta-add.is-confirmed:hover {
    background: transparent;
    color: var(--text);
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
    letter-spacing: 0.16em;
}
.detail-cta-add.is-confirmed::before { content: '\2713\00a0'; }
.detail-cta-add.is-confirmed .detail-cta-arrow { display: none; }

/* forgot-password: one-time code field */
input.login-field.uniart-code-field {
    letter-spacing: 0.45em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
