/*
Theme Name: The Signature Gallery
Theme URI: https://thesignaturegallery.example
Author: The Signature Gallery
Author URI: https://thesignaturegallery.example
Description: An editorial, auction-house style theme for fine art & collectibles galleries. Christie's-inspired: serif display type, generous whitespace, square edges, bordeaux accent. WooCommerce-ready for selling collection pieces and merch.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: signature-gallery
Tags: e-commerce, portfolio, custom-menu, featured-images, editorial, block-styles, full-width-template
WC requires at least: 6.0
WC tested up to: 9.0
*/

/* ===================== TOKENS ===================== */
:root {
  --bg: #ffffff;
  --surface: #f4f2f0;
  --surface-2: #eae7e3;
  --ink: #17140f;
  --muted: #6d675f;
  --line: #e3ddd6;
  --accent: #7a1f2b;        /* bordeaux */
  --accent-ink: #ffffff;
  --shadow: rgba(23,20,15,.11);
  --overlay: rgba(23,20,15,.45);

  --serif: "Playfair Display", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;

  --maxw: 1240px;
  --gut: clamp(20px, 5vw, 72px);
  --step-2: 1.35rem;
  --step-3: clamp(1.6rem, 3vw, 2.4rem);
  --step-4: clamp(2.4rem, 6vw, 4.6rem);
  --step-5: clamp(3rem, 9vw, 7rem);

  color-scheme: light;
}

/* ---- Dark theme ----
   Applied when the visitor picks it (data-theme="dark") or when they have no
   stored preference and their OS asks for dark. Every colour below is a token
   override only — components never restate colours inside a media query. */
:root[data-theme="dark"] {
  --bg: #0f0e0d;
  --surface: #171614;
  --surface-2: #201e1b;
  --ink: #f2ede5;
  --muted: #a79e92;
  --line: #2c2926;
  --accent: #d4697b;        /* bordeaux lifted so it holds up on a dark ground */
  --accent-ink: #17140f;
  --shadow: rgba(0,0,0,.55);
  --overlay: rgba(0,0,0,.6);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0f0e0d;
    --surface: #171614;
    --surface-2: #201e1b;
    --ink: #f2ede5;
    --muted: #a79e92;
    --line: #2c2926;
    --accent: #d4697b;
    --accent-ink: #17140f;
    --shadow: rgba(0,0,0,.55);
    --overlay: rgba(0,0,0,.6);

    color-scheme: dark;
  }
}

/* Images sit a touch calmer against a dark ground. */
:root[data-theme="dark"] .sg-card__media img,
:root[data-theme="dark"] .sg-story__media img { filter: brightness(.94); }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 400; line-height: 1.1; text-wrap: balance; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }

/* buttons */
.btn, .button, button.button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  display: inline-block; font-family: var(--sans); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 600; padding: 14px 30px; border: 1px solid var(--ink);
  color: var(--ink); background: transparent; cursor: pointer; transition: all .25s ease; border-radius: 0;
}
.btn:hover, .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--ink); color: var(--bg); }
.btn--solid, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce #respond input#submit {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.btn--solid:hover { filter: brightness(1.12); color: var(--accent-ink); }

/* ===================== UTILITY BAR ===================== */
.sg-util { border-bottom: 1px solid var(--line); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sg-util .wrap { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.sg-util .right { display: flex; gap: 20px; }

/* ===================== HEADER ===================== */
/* position:sticky makes the header the containing block for the full-width
   mega-menu panels, which is why the nav items themselves stay position:static. */
.sg-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 50; }
/* Edge-to-edge rather than capped at --maxw: a long gallery name plus seven
   nav items plus the search field needs the full width, and it matches the
   reference where the logo sits hard left and search hard right. */
.sg-header__bar {
  display: flex; align-items: center; gap: clamp(16px, 2.2vw, 36px);
  padding: 16px clamp(18px, 2.6vw, 46px);
}

.sg-logo { flex: none; font-family: var(--serif); font-size: clamp(.95rem, 1.25vw, 1.15rem); letter-spacing: .16em; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.sg-logo a { color: inherit; }
.sg-logo img { max-height: 44px; width: auto; }

.sg-header__actions { flex: none; margin-left: auto; display: flex; align-items: center; gap: clamp(10px, 1.4vw, 20px); }

/* search */
.sg-search { position: relative; display: flex; align-items: center; }
.sg-search input[type="search"] {
  width: clamp(150px, 17vw, 250px); background: transparent; border: 0;
  border-bottom: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-size: .86rem; padding: 8px 30px 8px 2px;
  transition: border-color .22s ease;
}
.sg-search input[type="search"]::placeholder { color: var(--muted); }
.sg-search input[type="search"]:focus { outline: 0; border-bottom-color: var(--accent); }
.sg-search button { position: absolute; right: 0; background: none; border: 0; cursor: pointer; color: var(--ink); display: grid; place-items: center; padding: 4px; }
.sg-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* icon buttons: theme toggle, cart, account */
.sg-iconbtn { position: relative; background: none; border: 0; cursor: pointer; color: var(--ink); display: grid; place-items: center; padding: 6px; line-height: 0; }
.sg-iconbtn:hover { color: var(--accent); }
.sg-cart-count {
  position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-family: var(--sans); font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center;
}
.sg-cart-count.is-empty { display: none; }

/* the sun/moon swap — only the relevant half is painted */
.sg-theme-toggle .sg-icon-moon { display: none; }
:root[data-theme="dark"] .sg-theme-toggle .sg-icon-sun { display: none; }
:root[data-theme="dark"] .sg-theme-toggle .sg-icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sg-theme-toggle .sg-icon-sun { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sg-theme-toggle .sg-icon-moon { display: block; }
}

/* ---- nav row ---- */
.sg-nav { display: flex; }
/* Child combinator keeps this off the dropdown lists nested inside. */
.sg-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(10px, 1.5vw, 24px); flex-wrap: nowrap; font-size: .73rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; }
.sg-nav > ul > li { position: static; }
.sg-nav > ul > li > a { display: inline-block; white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color .2s, color .2s; color: var(--ink); }
.sg-nav > ul > li > a:hover,
.sg-nav > ul > li.is-open > a,
.sg-nav > ul > li.current-menu-item > a,
.sg-nav > ul > li.current-menu-parent > a,
.sg-nav > ul > li.current-menu-ancestor > a { border-color: var(--accent); color: var(--ink); }

/* ---- mega-menu panel ---- */
.sg-nav > ul > li > .sub-menu {
  position: absolute; top: 100%; left: 0; right: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start;
  gap: 10px clamp(24px, 4vw, 64px); margin: 0; list-style: none;
  /* Full-bleed background, content aligned to the same grid as .wrap. */
  padding: 42px max(var(--gut), calc((100% - var(--maxw)) / 2 + var(--gut))) 54px;
  text-transform: none; letter-spacing: normal; font-size: .95rem; font-weight: 400;
  background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: 0 24px 44px -18px var(--shadow);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, visibility .2s;
  z-index: 60;
}
/* Opening is driven by .is-open from nav.js (hover intent with a close delay)
   rather than :hover — the pointer has to cross the header's bottom padding to
   reach the panel, and a bare :hover would drop it mid-journey. :focus-within
   stays so keyboard tabbing works with no script. */
.sg-nav > ul > li:focus-within > .sub-menu,
.sg-nav > ul > li.is-open > .sub-menu { opacity: 1; visibility: visible; pointer-events: auto; }

/* Level 2 = a column. Its link is the column heading. */
.sg-nav > ul > li > .sub-menu > li { break-inside: avoid; }
.sg-nav > ul > li > .sub-menu > li > a {
  display: block; padding: 0 0 18px; color: var(--accent);
  font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.sg-nav > ul > li > .sub-menu > li > a:hover { opacity: .75; }

/* Level 3 = the links inside a column. */
.sg-nav .sub-menu .sub-menu { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.sg-nav .sub-menu .sub-menu > li > a {
  display: block; padding: 9px 0; color: var(--ink); font-size: .95rem; letter-spacing: normal;
  text-transform: none; font-weight: 400; transition: color .18s ease;
}
.sg-nav .sub-menu .sub-menu > li > a:hover { color: var(--accent); }
.sg-nav .sub-menu .current-menu-item > a { color: var(--accent); }

/* A column with no children of its own still reads as a plain link list. */
.sg-nav > ul > li > .sub-menu > li:not(.menu-item-has-children) > a {
  color: var(--ink); font-size: .95rem; letter-spacing: normal; text-transform: none;
  font-weight: 400; padding: 9px 0;
}
.sg-nav > ul > li > .sub-menu > li:not(.menu-item-has-children) > a:hover { color: var(--accent); }

/* Add the CSS class "sg-viewall" to a menu item for the arrow treatment. */
.sg-nav .sub-menu .sg-viewall > a { color: var(--muted); }
.sg-nav .sub-menu .sg-viewall > a::before { content: "→"; margin-right: 10px; }
.sg-nav .sub-menu .sg-viewall > a:hover { color: var(--accent); }

/* Hover bridge so the pointer can cross into the panel. */
.sg-nav > ul > li.menu-item-has-children::after { content: none; }

/* chevron on top-level parents */
.sg-nav > ul > li.menu-item-has-children > a::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: translateY(-2px) rotate(45deg); opacity: .55;
}

/* mobile submenu toggle — injected by nav.js, desktop hides it */
.sg-submenu-toggle { display: none; }

.sg-burger { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 6px; line-height: 0; }

/* ===================== HERO SLIDER ===================== */
.sg-slider { position: relative; border-bottom: 1px solid var(--line); }
.sg-slide { display: grid; grid-template-columns: 1.12fr 1fr; align-items: stretch; }
.sg-slide[hidden] { display: none; }
.sg-slide.is-entering .sg-slide__panel-inner > *,
.sg-slide.is-entering .sg-slide__media { animation: sgFade .7s ease both; }
.sg-slide.is-entering .sg-slide__panel-inner > *:nth-child(2) { animation-delay: .06s; }
.sg-slide.is-entering .sg-slide__panel-inner > *:nth-child(3) { animation-delay: .12s; }
.sg-slide.is-entering .sg-slide__panel-inner > *:nth-child(4) { animation-delay: .18s; }
.sg-slide.is-entering .sg-slide__panel-inner > *:nth-child(5) { animation-delay: .24s; }
@keyframes sgFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* media side */
.sg-slide__media { position: relative; overflow: hidden; background: var(--surface-2); min-height: clamp(300px, 46vh, 620px); }
.sg-slide__media img,
.sg-slide__video { width: 100%; height: 100%; object-fit: cover; }
.sg-slide__placeholder { position: absolute; inset: 0; }
.sg-slide__placeholder--1 { background: radial-gradient(120% 90% at 30% 20%, #b9433f, #6d1f2c 55%, #2a1116); }
.sg-slide__placeholder--2 { background: linear-gradient(160deg, #23303f, #7c8aa0 120%); }
.sg-slide__placeholder--3 { background: linear-gradient(200deg, #d9c9a3, #8a6d3f 90%); }

/* video pause toggle */
.sg-slide__playpause {
  position: absolute; top: 18px; right: 18px; width: 46px; height: 46px; border: 0;
  border-radius: 999px; background: rgba(255,255,255,.28); backdrop-filter: blur(6px);
  display: grid; place-items: center; cursor: pointer; transition: background .25s ease;
}
.sg-slide__playpause:hover { background: rgba(255,255,255,.46); }
.sg-slide__playpause-icon { display: block; width: 14px; height: 15px; position: relative; }
.sg-slide__playpause-icon::before,
.sg-slide__playpause-icon::after {
  content: ""; position: absolute; top: 0; width: 4px; height: 15px; background: #fff; border-radius: 1px;
}
.sg-slide__playpause-icon::before { left: 1px; }
.sg-slide__playpause-icon::after { right: 1px; }
/* paused state → show a play triangle instead */
.sg-slide__playpause.is-paused .sg-slide__playpause-icon::after { display: none; }
.sg-slide__playpause.is-paused .sg-slide__playpause-icon::before {
  left: 3px; width: 0; height: 0; background: transparent; border-radius: 0;
  border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; border-left: 12px solid #fff;
}

/* panel side */
.sg-slide__panel { background: var(--panel-bg, var(--surface)); color: var(--panel-ink, var(--ink)); display: flex; align-items: center; }
.sg-slide__panel-inner { display: flex; flex-direction: column; gap: 18px; padding: clamp(34px, 5vw, 76px) clamp(24px, 4vw, 64px); width: 100%; }
.sg-slide__eyebrow { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--panel-ink, var(--ink)); opacity: .85; margin: 0; font-weight: 500; }
.sg-slide__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1.04; margin: 0; color: inherit; }
.sg-slide__subtitle { font-family: var(--serif); font-size: clamp(1.05rem, 1.5vw, 1.45rem); line-height: 1.35; margin: 0; max-width: 34ch; color: var(--panel-ink, var(--ink)); opacity: .88; }

.sg-slide__meta { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sg-slide__meta li { display: flex; align-items: center; gap: 14px; font-size: .88rem; letter-spacing: .1em; text-transform: uppercase; }
.sg-slide__icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.sg-slide__btn {
  display: block; text-align: center; margin-top: 10px; padding: 17px 34px;
  background: var(--panel-btn, var(--ink)); color: var(--panel-btnink, #fff);
  font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--panel-btn, var(--ink)); transition: opacity .25s ease;
}
.sg-slide__btn:hover { opacity: .84; color: var(--panel-btnink, #fff); }

/* dots */
.sg-slider__dots { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.sg-dot { position: relative; width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.sg-dot__core { width: 7px; height: 7px; border-radius: 999px; background: currentColor; opacity: .42; transition: opacity .25s ease; }
.sg-dot.is-active .sg-dot__core { opacity: 1; }
.sg-dot__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.sg-dot__ring circle {
  fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0;
  stroke-dasharray: 63; stroke-dashoffset: 63;
}
.sg-dot.is-counting .sg-dot__ring circle {
  opacity: .85;
  animation: sgRing var(--sg-duration, 7000ms) linear forwards;
}
@keyframes sgRing { from { stroke-dashoffset: 63; } to { stroke-dashoffset: 0; } }

.sg-slide__playpause:focus-visible,
.sg-dot:focus-visible,
.sg-slide__btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .sg-slide.is-entering .sg-slide__panel-inner > *,
  .sg-slide.is-entering .sg-slide__media { animation: none; }
  .sg-dot.is-counting .sg-dot__ring circle { animation: none; opacity: 0; }
}

/* ===================== SECTIONS ===================== */
.sg-section { padding: clamp(56px,8vw,100px) 0; border-bottom: 1px solid var(--line); }
.sg-section--surface { background: var(--surface); }
.sg-sechead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.sg-sechead h2 { font-size: var(--step-4); margin: 0; }
.sg-seclink { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; border-bottom: 2px solid var(--accent); padding-bottom: 3px; color: var(--ink); }

/* product / card grids */
.sg-grid { display: grid; gap: clamp(16px, 2.5vw, 30px); }
.sg-grid--3 { grid-template-columns: repeat(3, 1fr); }
.sg-grid--4 { grid-template-columns: repeat(4, 1fr); }
.sg-card__media { aspect-ratio: 3/4; background: var(--surface-2); overflow: hidden; }
.sg-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.sg-card:hover .sg-card__media img { transform: scale(1.04); }
.sg-card__body { padding: 14px 0 0; }
.sg-card__artist { font-weight: 600; font-size: .92rem; }
.sg-card__title { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .96rem; margin: 2px 0 8px; }
.sg-card__price { font-size: .82rem; }

/* departments / links grid */
.sg-tiles { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sg-tile { background: var(--bg); padding: 34px 30px; display: flex; justify-content: space-between; align-items: center; transition: background .25s; }
.sg-tile:hover { background: var(--surface-2); color: var(--ink); }
.sg-tile span { font-family: var(--serif); font-size: var(--step-2); }
.sg-tile em { font-style: normal; color: var(--accent); font-size: 1.2rem; }

/* stories */
.sg-stories { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(20px,3vw,38px); }
.sg-story__media { aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.sg-story--lead .sg-story__media { aspect-ratio: 4/3; }
.sg-story__media img { width: 100%; height: 100%; object-fit: cover; }
.sg-story__body { padding-top: 14px; }
.sg-story h3 { margin: 8px 0; font-size: var(--step-2); }
.sg-story--lead h3 { font-size: var(--step-3); }
.sg-story p { color: var(--muted); font-size: .92rem; margin: 0; }

/* newsletter */
.sg-news { background: var(--ink); color: #fff; text-align: center; }
.sg-news h2 { color: #fff; font-size: var(--step-4); margin: 0 0 14px; }
.sg-news p { color: rgba(255,255,255,.6); max-width: 46ch; margin: 0 auto 26px; }
.sg-news form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.sg-news input[type=email] { flex: 1; min-width: 220px; background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 14px 16px; font-family: var(--sans); }
.sg-news input::placeholder { color: rgba(255,255,255,.5); }

/* ===================== PAGE / POST CONTENT ===================== */
.sg-page { padding: clamp(48px,7vw,90px) 0; }
.sg-page__head { text-align: center; max-width: 760px; margin: 0 auto clamp(32px,5vw,60px); }
.sg-page__head h1 { font-size: var(--step-4); margin: 0 0 12px; }
.sg-page__head p { color: var(--muted); }
.sg-content { max-width: 760px; margin: 0 auto; }
.sg-content h2 { font-size: var(--step-3); margin: 1.6em 0 .5em; }
.sg-content h3 { font-size: var(--step-2); margin: 1.4em 0 .4em; }
.sg-content p { margin: 0 0 1.2em; }
.sg-content img { margin: 1.4em 0; }
.sg-content a { border-bottom: 1px solid var(--accent); }

/* blog archive */
.sg-archive { display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(20px,3vw,40px); }
.sg-archive .sg-story__media { aspect-ratio: 3/2; }

/* ===================== SHOP ===================== */
.woo-wrap { padding: clamp(32px,5vw,64px) 0 clamp(56px,8vw,96px); }

/* --- shop hero + category filter bar --- */
.sg-shop-head { text-align: center; max-width: 760px; margin: 0 auto clamp(26px,3.5vw,40px); }
.sg-shop-head .eyebrow { display: block; margin-bottom: 16px; color: var(--accent); }
.sg-shop-head h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); margin: 0 0 16px; letter-spacing: -.01em; }
.sg-shop-head p { color: var(--muted); margin: 0 auto; max-width: 56ch; font-size: 1.02rem; }

/* Letter-spaced text links with a bordeaux rule on the active one — closer to
   how an auction house indexes departments than a row of buttons. */
.sg-cats {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: 4px clamp(18px, 2.6vw, 40px); margin: 0 0 clamp(34px,5vw,56px); padding: 0 0 22px;
  list-style: none; border-bottom: 1px solid var(--line);
}
.sg-cats a {
  display: block; padding: 6px 0; color: var(--muted);
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
  border-bottom: 2px solid transparent; transition: color .2s ease, border-color .2s ease;
}
.sg-cats a:hover { color: var(--ink); }
.sg-cats .is-current a { color: var(--ink); border-bottom-color: var(--accent); }
.sg-cats .sg-cats__count { font-weight: 400; margin-left: 5px; opacity: .7; font-size: .92em; }

/* --- toolbar (count + sorting) --- */
.woocommerce .sg-shop-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: clamp(24px,3vw,36px); border-bottom: 1px solid var(--line); }
.woocommerce .woocommerce-result-count { margin: 0; color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.woocommerce .woocommerce-ordering { margin: 0; }
.woocommerce .woocommerce-ordering select {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 0;
}

/* --- product grid --- */
/* minmax(0, 1fr) rather than 1fr: a bare 1fr floors at the content's min size,
   so one long title or a wide image can push the whole row past the viewport. */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(26px,3.4vw,48px) clamp(16px,2.4vw,30px); margin: 0; padding: 0; list-style: none;
}
.woocommerce ul.products li.product { min-width: 0; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { overflow-wrap: break-word; }
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none !important; display: none !important; }
.woocommerce ul.products li.product {
  width: auto !important; margin: 0 !important; float: none !important; text-align: left; clear: none !important;
}
.woocommerce ul.products li.product a img { margin: 0; }

/* the image frame */
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product > a:first-of-type { display: block; }
/* Each work sits on a pale mat inside its frame rather than filling it, so
   varied crops and orientations still line up as a tidy grid. */
.woocommerce ul.products li.product .sg-loop-media {
  position: relative; overflow: hidden; aspect-ratio: 3 / 4;
  background: var(--surface); display: grid; place-items: center;
  padding: clamp(10px, 1.6vw, 22px);
}
.woocommerce ul.products li.product .sg-loop-media img {
  width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain;
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 12px 28px -18px var(--shadow);
}
.woocommerce ul.products li.product:hover .sg-loop-media img { transform: scale(1.04); }

/* Out-of-stock works read as "Sold" rather than simply unavailable. */
.woocommerce ul.products li.product.outofstock .sg-loop-media::after {
  content: "Sold"; position: absolute; inset: auto 0 0 0; padding: 10px;
  background: var(--ink); color: var(--bg); text-align: center;
  font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--serif); font-weight: 400; font-size: 1.06rem; line-height: 1.25;
  padding: 16px 0 4px; margin: 0; color: var(--ink);
}
.woocommerce ul.products li.product .price {
  color: var(--ink); font-family: var(--sans); font-size: .86rem; font-weight: 500;
  display: block; margin: 0 0 10px;
}
.woocommerce ul.products li.product .price del { color: var(--muted); opacity: .7; margin-right: 6px; }
.woocommerce ul.products li.product .price ins { text-decoration: none; color: var(--accent); }
.woocommerce ul.products li.product .sg-loop-cat {
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}

/* add-to-cart reveals on hover, stays visible on touch */
.woocommerce ul.products li.product .button {
  display: inline-block; padding: 11px 22px; font-size: .68rem; letter-spacing: .14em;
  margin: 0; opacity: 1; transform: none;
}
@media (hover: hover) and (min-width: 981px) {
  .woocommerce ul.products li.product .button { opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease, background .25s ease, color .25s ease; }
  .woocommerce ul.products li.product:hover .button,
  .woocommerce ul.products li.product:focus-within .button { opacity: 1; transform: none; }
}
.woocommerce ul.products li.product .added_to_cart {
  display: inline-block; margin-left: 12px; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 600; color: var(--accent); border-bottom: 1px solid currentColor;
}
.woocommerce span.onsale {
  position: absolute; top: 12px; left: 12px; z-index: 2; margin: 0; padding: 6px 12px;
  background: var(--accent); color: var(--accent-ink); border-radius: 0; min-height: 0; min-width: 0;
  font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; line-height: 1.4;
}

/* --- single product ---
   Images and summary share row 1; everything after (tabs, related) spans the
   full width and flows below. No row spanning — an earlier version used
   grid-row: 1 / span 20 to stretch the image column and that forced eighteen
   empty rows between the summary and the tabs. */
.woocommerce div.product {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px,4.5vw,68px); align-items: start;
}
.woocommerce div.product > * { grid-column: 1 / -1; min-width: 0; }
.woocommerce div.product > div.images,
.woocommerce div.product > .woocommerce-product-gallery { grid-column: 1; grid-row: 1; margin: 0; }
.woocommerce div.product > .summary { grid-column: 2; grid-row: 1; margin: 0; }

/* The work is matted rather than bled to the edge — it reads as framed. */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper { margin: 0; }
.woocommerce div.product div.images img {
  width: 100%; background: var(--surface); display: block;
}
.woocommerce div.product div.images .woocommerce-product-gallery__image {
  background: var(--surface); padding: clamp(16px, 3vw, 44px);
}
.woocommerce div.product div.images .woocommerce-product-gallery__image img { box-shadow: 0 18px 40px -22px var(--shadow); }
.woocommerce div.product div.images .flex-viewport { background: var(--surface); }

/* Details stay in view while a tall work scrolls past. */
@media (min-width: 981px) {
  .woocommerce div.product > .summary { position: sticky; top: 120px; }
}
/* This is an <ol>, so the markers have to be cleared explicitly. */
.woocommerce div.product .flex-control-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.woocommerce div.product .flex-control-thumbs li::marker { content: none; }
.woocommerce div.product .flex-control-thumbs li { width: auto; margin: 0; float: none; }
.woocommerce div.product .flex-control-thumbs img { opacity: .55; transition: opacity .2s ease; }
.woocommerce div.product .flex-control-thumbs img.flex-active,
.woocommerce div.product .flex-control-thumbs img:hover { opacity: 1; }

.woocommerce div.product .sg-product-cat { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.woocommerce div.product .product_title { font-size: clamp(1.9rem,3.4vw,3rem); line-height: 1.06; margin: 0 0 18px; }
.woocommerce div.product p.price,
.woocommerce div.product span.price { color: var(--ink); font-family: var(--sans); font-size: 1.15rem; font-weight: 500; margin: 0 0 6px; }
.woocommerce div.product p.price del { color: var(--muted); }
.woocommerce div.product p.price ins { text-decoration: none; color: var(--accent); }
.woocommerce div.product .sg-price-note { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 24px; }
.woocommerce div.product .woocommerce-product-details__short-description { color: var(--muted); font-size: 1rem; line-height: 1.65; margin: 0 0 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.woocommerce div.product .woocommerce-product-details__short-description p:last-child { margin-bottom: 0; }

.woocommerce div.product form.cart { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin: 0 0 26px; }
.woocommerce div.product form.cart div.quantity { margin: 0; display: flex; }
.woocommerce .quantity input.qty {
  width: 74px; height: 100%; min-height: 50px; background: transparent; border: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: .95rem; text-align: center; border-radius: 0;
}
.woocommerce div.product form.cart button.button,
.woocommerce div.product form.cart .single_add_to_cart_button { flex: 1; min-width: 200px; padding: 17px 34px; font-size: .74rem; }
.woocommerce div.product .product_meta { font-size: .82rem; color: var(--muted); padding-top: 22px; border-top: 1px solid var(--line); }
.woocommerce div.product .product_meta > span { display: block; margin-bottom: 7px; }
.woocommerce div.product .product_meta a { color: var(--ink); border-bottom: 1px solid var(--line); }
.woocommerce div.product .product_meta a:hover { color: var(--accent); border-color: currentColor; }

/* specification rows from product attributes */
.sg-specs {
  display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
  gap: 0; margin: 0 0 28px; padding: 0; border-top: 1px solid var(--line);
}
.sg-specs dt,
.sg-specs dd {
  margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .89rem;
}
.sg-specs dt { color: var(--muted); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; padding-right: 16px; }
.sg-specs dd { color: var(--ink); }

/* trust row under the buy button */
.sg-assurances { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; }
.sg-assurances li { display: flex; align-items: flex-start; gap: 12px; font-size: .87rem; color: var(--muted); }
.sg-assurances .sg-icon { width: 17px; height: 17px; margin-top: 3px; flex: none; color: var(--accent); }

/* secondary route: talk to someone instead of buying now */
.sg-enquire { margin: 0 0 26px; }
.sg-enquire a {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 3px;
}
.sg-enquire a:hover { color: var(--accent); }

/* ===================== PAGE PRODUCT SHOWCASE ===================== */
.sg-showcase { padding: clamp(40px,6vw,80px) 0 clamp(48px,7vw,90px); border-top: 1px solid var(--line); }
.sg-showcase .sg-sechead { justify-content: center; text-align: center; margin-bottom: 34px; }
.sg-showcase .sg-sechead h2 { font-size: clamp(1.9rem,3.6vw,3rem); }
/* The shortcode prints its own .woocommerce wrapper; keep the grid rules working. */
.sg-showcase .woocommerce ul.products { margin: 0; }

/* tabs */
.woocommerce div.product .woocommerce-tabs { margin-top: clamp(48px,7vw,88px); }
.woocommerce div.product .woocommerce-tabs ul.tabs { padding: 0; margin: 0 0 30px; border-bottom: 1px solid var(--line); display: flex; gap: 30px; flex-wrap: wrap; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: none; border: 0; border-radius: 0; margin: 0; padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  padding: 0 0 14px; font-family: var(--sans); font-size: .76rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--ink); border-color: var(--accent); }
.woocommerce div.product .woocommerce-tabs .panel { max-width: 780px; }
.woocommerce div.product .woocommerce-tabs .panel h2 { font-size: var(--step-3); }

/* related products */
.woocommerce .related > h2,
.woocommerce .upsells > h2,
.woocommerce .cross-sells > h2 { font-family: var(--serif); font-weight: 400; font-size: var(--step-3); margin: clamp(48px,7vw,88px) 0 30px; }

/* --- cart --- */
.woocommerce-cart .woocommerce { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(28px,4vw,56px); align-items: start; }
.woocommerce-cart .woocommerce > form.woocommerce-cart-form { grid-column: 1; margin: 0; }
.woocommerce-cart .cart-collaterals { grid-column: 2; width: auto; float: none; }
.woocommerce-cart .cart-collaterals .cart_totals { width: auto; float: none; }
.woocommerce-cart .woocommerce-notices-wrapper,
.woocommerce-cart .cross-sells { grid-column: 1 / -1; }

.woocommerce table.shop_table {
  border: 0; border-radius: 0; border-collapse: collapse; width: 100%; margin: 0;
}
.woocommerce table.shop_table th {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 0 12px 14px 0; border-bottom: 1px solid var(--line);
}
.woocommerce table.shop_table td { padding: 22px 12px 22px 0; border-top: 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.woocommerce table.shop_table .product-thumbnail img { width: 92px; aspect-ratio: 3/4; object-fit: cover; background: var(--surface-2); }
.woocommerce table.shop_table .product-name a { font-family: var(--serif); font-size: 1.08rem; color: var(--ink); }
.woocommerce table.shop_table .product-name a:hover { color: var(--accent); }
.woocommerce table.shop_table td.product-price,
.woocommerce table.shop_table td.product-subtotal { font-variant-numeric: tabular-nums; }
.woocommerce a.remove {
  width: 26px; height: 26px; line-height: 24px; font-size: 1.1rem; color: var(--muted) !important;
  border-radius: 0; text-align: center;
}
.woocommerce a.remove:hover { background: transparent !important; color: var(--accent) !important; }
.woocommerce .cart .actions { padding-top: 24px !important; }
.woocommerce .cart .actions .coupon { display: flex; gap: 10px; align-items: stretch; }
.woocommerce .cart .actions .coupon input#coupon_code {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); padding: 14px 16px; border-radius: 0; width: auto; min-width: 160px;
}

.woocommerce .cart_totals { background: var(--surface); padding: clamp(24px,3vw,34px); }
.woocommerce .cart_totals h2 { font-family: var(--serif); font-weight: 400; font-size: var(--step-2); margin: 0 0 20px; }
.woocommerce .cart_totals table { border: 0; margin: 0; }
.woocommerce .cart_totals table th,
.woocommerce .cart_totals table td { border: 0; border-bottom: 1px solid var(--line); padding: 14px 0; font-size: .92rem; }
.woocommerce .cart_totals table th { font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); width: 45%; }
.woocommerce .cart_totals .order-total th,
.woocommerce .cart_totals .order-total td { border-bottom: 0; padding-top: 18px; }
.woocommerce .cart_totals .order-total td { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.woocommerce .wc-proceed-to-checkout { padding: 22px 0 0 !important; }
.woocommerce .wc-proceed-to-checkout a.checkout-button { display: block; text-align: center; margin: 0; padding: 18px 30px; font-size: .76rem; }

/* empty cart */
.woocommerce .cart-empty,
.woocommerce .wc-empty-cart-message { text-align: center; font-family: var(--serif); font-size: var(--step-3); color: var(--ink); margin: 40px 0 20px; }
.woocommerce .return-to-shop { text-align: center; margin-bottom: 40px; }

/* --- checkout --- */
.woocommerce-checkout .woocommerce form.checkout { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px,4vw,56px); align-items: start; }
.woocommerce-checkout #customer_details { grid-column: 1; }
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review { grid-column: 2; }
.woocommerce-checkout #order_review { background: var(--surface); padding: clamp(22px,3vw,30px); }
.woocommerce form .form-row label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row .select2-container .select2-selection {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-size: .95rem; padding: 13px 14px; border-radius: 0;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus { outline: 0; border-color: var(--accent); }
.woocommerce-checkout h3 { font-family: var(--serif); font-weight: 400; font-size: var(--step-2); }

/* --- notices --- */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
  background: var(--surface); border-top: 3px solid var(--accent); color: var(--ink);
  border-radius: 0; padding: 18px 20px 18px 46px; font-size: .93rem;
}
.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before,
.woocommerce .woocommerce-error::before { color: var(--accent); top: 20px; left: 20px; }
.woocommerce .woocommerce-message .button { padding: 10px 20px; font-size: .68rem; }

/* --- pagination --- */
.woocommerce nav.woocommerce-pagination { margin-top: clamp(40px,6vw,64px); }
.woocommerce nav.woocommerce-pagination ul { border: 0; display: flex; justify-content: center; gap: 8px; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; margin: 0; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  min-width: 42px; padding: 11px 8px; border: 1px solid var(--line); background: transparent;
  color: var(--ink); font-size: .82rem; text-align: center;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ===================== FOOTER ===================== */
.sg-footer { background: var(--surface); padding: 68px 0 36px; }
.sg-fgrid { display: grid; grid-template-columns: 1.5fr repeat(4,1fr); gap: 40px 30px; }
/* The header logo moved to .sg-logo; the footer keeps its own wordmark. */
.sg-fbrand .sg-wordmark { font-family: var(--serif); font-size: 1.35rem; letter-spacing: .2em; color: var(--ink); text-align: left; }
.sg-fbrand .sg-wordmark img { max-height: 44px; width: auto; }
.sg-fbrand p { color: var(--muted); font-size: .88rem; max-width: 30ch; margin-top: 14px; }
.sg-fcol h4 { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.sg-fcol ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.sg-fbottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
  /* Stack the hero: media on top, coloured panel beneath. A fixed ratio keeps
     the media from eating the screen on tall phones the way a vh value does. */
  .sg-slide { grid-template-columns: 1fr; }
  .sg-slide__media { min-height: 0; aspect-ratio: 4 / 3; }
  .sg-slide__title { font-size: clamp(2rem, 8vw, 2.9rem); }
  .sg-grid--4 { grid-template-columns: repeat(2,1fr); }
  .sg-grid--3, .sg-tiles { grid-template-columns: repeat(2,1fr); }
  .sg-stories, .sg-archive { grid-template-columns: 1fr; }
  .sg-fgrid { grid-template-columns: 1fr 1fr; }

  /* Shop, product, cart and checkout all collapse to a single column. */
  .woocommerce ul.products,
  .woocommerce-page ul.products { grid-template-columns: repeat(2, 1fr); }
  .woocommerce div.product { grid-template-columns: 1fr; }
  .woocommerce div.product div.images,
  .woocommerce div.product .summary { grid-column: 1; grid-row: auto / auto; }
  .woocommerce-cart .woocommerce,
  .woocommerce-checkout .woocommerce form.checkout { grid-template-columns: 1fr; }
  .woocommerce-cart .woocommerce > form.woocommerce-cart-form,
  .woocommerce-cart .cart-collaterals,
  .woocommerce-checkout #customer_details,
  .woocommerce-checkout #order_review_heading,
  .woocommerce-checkout #order_review { grid-column: 1; }
  .sg-burger { display: block; order: -1; }
  .sg-header__bar { flex-wrap: wrap; gap: 12px; padding: 14px var(--gut); }
  .sg-logo { font-size: clamp(.85rem, 3.2vw, 1.1rem); letter-spacing: .14em; }

  /* The drawer drops below the bar and spans the full width. */
  .sg-nav { display: none; order: 10; width: 100%; }
  .sg-nav.is-open { display: block; }
  .sg-nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 10px; flex-wrap: wrap; }
  .sg-nav > ul > li { border-top: 1px solid var(--line); position: relative; }
  .sg-nav > ul > li > a { display: block; padding: 15px 0; border-bottom: 0; white-space: normal; }

  /* Mega panels become in-flow accordions rather than floating grids. */
  .sg-nav > ul > li > .sub-menu,
  .sg-nav .sub-menu {
    position: static; display: block; opacity: 1; visibility: visible; pointer-events: auto;
    min-width: 0; border: 0; box-shadow: none; background: var(--surface);
    padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease;
    grid-template-columns: none;
  }
  .sg-nav > ul > li.is-open > .sub-menu { max-height: 70vh; overflow-y: auto; padding: 4px 0 10px; }
  .sg-nav .sub-menu .sub-menu { max-height: none; overflow: visible; background: transparent; padding: 0; }

  .sg-nav > ul > li > .sub-menu > li > a { padding: 12px 14px 6px; }
  .sg-nav .sub-menu .sub-menu > li > a { padding: 11px 26px; }
  .sg-nav > ul > li > .sub-menu > li:not(.menu-item-has-children) > a { padding: 11px 14px; }

  /* The chevron moves onto the toggle button. */
  .sg-nav > ul > li.menu-item-has-children > a::after { display: none; }
  .sg-nav > ul > li.menu-item-has-children { display: grid; grid-template-columns: 1fr auto; }
  .sg-nav > ul > li.menu-item-has-children > .sub-menu { grid-column: 1 / -1; }
  /* Only top-level items get a toggle; level-2 headings stay open in the drawer. */
  .sg-nav > ul > li.menu-item-has-children > .sg-submenu-toggle {
    display: grid; place-items: center; width: 54px; background: none; border: 0;
    cursor: pointer; color: var(--ink);
  }
  .sg-nav > ul > li.menu-item-has-children > .sg-submenu-toggle::before {
    content: ""; width: 8px; height: 8px;
    border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
    transform: translateY(-2px) rotate(45deg); transition: transform .25s ease;
  }
  .sg-nav > ul > li.is-open > .sg-submenu-toggle::before { transform: translateY(1px) rotate(225deg); }
}

/* Search collapses to an icon well before the nav runs out of room. */
@media (max-width: 1560px) and (min-width: 981px) {
  .sg-search { position: static; }
  .sg-search input[type="search"] {
    position: absolute; top: 100%; right: clamp(18px, 2.6vw, 46px); width: min(320px, 60vw);
    background: var(--bg); border: 1px solid var(--line); padding: 12px 14px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s; z-index: 70;
  }
  .sg-search.is-open input[type="search"] { opacity: 1; visibility: visible; transform: translateY(6px); }
  .sg-search button { position: static; }
}

/* Below this the row cannot hold logo + seven items + actions, so the nav
   takes a centred row of its own. Still desktop, still a single nav line. */
@media (max-width: 1300px) and (min-width: 981px) {
  .sg-header__bar { flex-wrap: wrap; row-gap: 4px; }
  .sg-header__actions { order: 2; }
  .sg-nav { order: 3; flex: 1 0 100%; justify-content: center; }
  .sg-nav > ul { justify-content: center; padding-top: 2px; }
}
@media (max-width: 700px) {
  /* Tighten the wordmark's tracking and keep clear of the burger (left) and
     the cart link (right) — a long gallery name wraps to two centred lines
     rather than colliding with either. */
  .sg-brandrow { padding: 16px 74px 10px; }
  .sg-wordmark { font-size: clamp(.95rem, 4vw, 1.4rem); letter-spacing: .16em; padding-left: .16em; line-height: 1.32; }
  .sg-burger { left: 14px; }
  .sg-header-actions { right: 14px; }
  .sg-sechead h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
}

@media (max-width: 560px) {
  .sg-grid--4, .sg-grid--3, .sg-tiles, .sg-fgrid { grid-template-columns: 1fr; }
  .sg-util .left { display: none; }
  .sg-header__actions { gap: 6px; }

  /* Two columns still read well for merch; keep them rather than stacking. */
  .woocommerce ul.products,
  .woocommerce-page ul.products { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: .96rem; }
  .woocommerce table.shop_table .product-thumbnail img { width: 64px; }
  .woocommerce div.product form.cart button.button { min-width: 0; }
}

/* The header search input is always a collapsing panel on phones. */
@media (max-width: 980px) {
  .sg-search { position: static; }
  .sg-search input[type="search"] {
    position: absolute; top: 100%; left: 0; right: 0; width: 100%;
    background: var(--bg); border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 15px var(--gut); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; z-index: 70;
  }
  .sg-search.is-open input[type="search"] { opacity: 1; visibility: visible; }
  .sg-search button { position: static; }
}
