:root { --brand: #2c3e50; --brand-dark: #1f2d3a; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2933; background: #f5f6f8; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
header.site { background: var(--brand); color: #fff; }
header.site .container { display: flex; align-items: center; gap: 24px; height: 64px; }
header.site a { color: #fff; }
header.site .logo { font-weight: 700; font-size: 20px; }
header.site nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.badge { background: #fff; color: var(--brand); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; padding: 9px 16px;
  border-radius: 6px; cursor: pointer; font-size: 14px; text-align: center; }
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #e4e7eb; color: #1f2933; }
.btn.danger { background: #c0392b; }
.btn.small { padding: 5px 10px; font-size: 13px; }

/* Layout helpers */
main { padding: 28px 0 60px; }
.card { background: #fff; border: 1px solid #e4e7eb; border-radius: 8px; padding: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.muted { color: #7b8794; font-size: 14px; }
.price { font-weight: 700; font-size: 18px; color: var(--brand); }
h1 { font-size: 26px; } h2 { font-size: 20px; }

/* ── Product card (shared component, adapts per brand via --accent/--brand) ── */
.pcard-grid { display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pcard { display: flex; flex-direction: column; }
.pcard-media { position: relative; display: block; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden; background: #eef1f4; }
.pcard-img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: opacity .45s ease, transform .6s ease; }
.pcard-img--hover { opacity: 0; }
.pcard-media:hover .pcard-img--hover { opacity: 1; }
.pcard-media:hover .pcard-img { transform: scale(1.04); }
.pcard-ph { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 56px; font-weight: 800;
  color: var(--brand); background: #e9edf1; }

.pcard-body { padding: 12px 2px 0; }
.pcard-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: var(--accent, var(--brand)); }
.pcard-title { font-size: 16px; line-height: 1.25; margin: 4px 0 10px; }
.pcard-title a { color: inherit; }
.pcard-title a:hover { color: var(--accent, var(--brand)); text-decoration: none; }

.pcard-variants { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pcard-variant { font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 11px;
  border-radius: 999px; border: 1px solid #d7dde3; background: #fff; color: #3e4c59; }
.pcard-variant:hover { border-color: var(--accent, var(--brand));
  color: var(--accent, var(--brand)); text-decoration: none; }
.pcard-variant--more { background: #f1f3f5; color: #7b8794; }

.pcard-price { font-weight: 700; font-size: 15px; margin: 0;
  color: var(--accent, var(--brand)); }
.pcard-price--locked { font-weight: 600; font-size: 13px; color: #7b8794; }
.pcard-price--locked:hover { color: var(--accent, var(--brand)); text-decoration: none; }

/* ── Product detail page ── */
/* Picture 1/3 (left), text 2/3 (right). minmax(0,…) keeps the ratio strict. */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .pdp { grid-template-columns: 1fr; } }
.pdp-media { position: sticky; top: 18px; }
.pdp-main { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff;
  border: 1px solid #e4e7eb; border-radius: 12px; }
.pdp-main-ph { display: flex; align-items: center; justify-content: center;
  font-size: 72px; font-weight: 800; color: var(--accent, var(--brand)); background: #eef1f4; }
.pdp-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pdp-thumb { width: 72px; height: 72px; object-fit: cover; background: #fff; cursor: pointer;
  border: 1px solid #e4e7eb; border-radius: 8px; transition: border-color .15s; }
.pdp-thumb:hover { border-color: var(--accent, var(--brand)); }
.pdp-thumb.is-active { border-color: var(--accent, var(--brand)); box-shadow: 0 0 0 1px var(--accent, var(--brand)); }
.pdp-desc { max-width: none; font-size: 15px; margin-bottom: 18px; }
.pdp-formats-wrap { margin-top: 30px; }
.pdp-formats th, .pdp-formats td { vertical-align: middle; }
.fmt-name { display: flex; align-items: center; gap: 8px; }
.fmt-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
  border: 1px solid #e4e7eb; background: #fff; flex: none; }

/* ── Content blocks (shared library; themed via --brand/--accent) ── */
.block { margin: 0 0 44px; }
/* manual product list always lays out 4 per line (2 on small screens) */
.pcard-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .pcard-grid--4 { grid-template-columns: repeat(2, 1fr); } }
/* category list — pill buttons linking to the filtered catalogue */
.block-categories { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-pill { background: #fff; border: 1px solid #d7dde3; color: var(--brand);
  padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.cat-pill:hover { background: var(--accent, var(--brand)); border-color: var(--accent, var(--brand));
  color: #fff; text-decoration: none; }
/* page list — buttons linking to editorial pages */
.block-page-links { display: flex; flex-wrap: wrap; gap: 10px; }
.block-h2 { font-size: 28px; margin: 0 0 18px; }
.block-eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px;
  font-weight: 700; color: var(--accent, var(--brand)); margin: 0 0 10px; }

/* banner */
.block-banner { position: relative; border-radius: 16px; overflow: hidden;
  padding: 64px 48px; margin-bottom: 40px; background-color: #eef1f4;
  background-size: cover; background-position: center; }
.block-banner::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0)); }
.block-banner-inner { position: relative; z-index: 1; max-width: 620px; color: #fff; }
.block-banner-inner h1 { color: #fff; font-size: 46px; margin: 0 0 14px; }
.block-banner-sub { font-size: 18px; margin: 0 0 22px; opacity: .95; }
.block-banner:not([style]) .block-banner-inner,
.block-banner:not([style]) .block-banner-inner h1 { color: var(--brand); }
.block-banner:not([style])::after { display: none; }

/* rich text */
.block-richtext { font-size: 16px; line-height: 1.7; max-width: 760px; }
.block-richtext h2, .block-richtext h3 { margin-top: 1.4em; }
.block-richtext img { max-width: 100%; border-radius: 8px; }

/* feature row */
.block-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; }
.block-feature { background: #fff; border: 1px solid #e4e7eb; border-radius: 12px;
  padding: 22px; border-top: 4px solid var(--accent, var(--brand)); }
.block-feature-icon { font-size: 26px; }
.block-feature h3 { margin: 10px 0 6px; font-size: 18px; }
.block-feature p { margin: 0; color: #5a6b78; font-size: 14px; }

/* slider / carousel — all slides stacked in one grid cell, cross-faded on
   opacity (no display toggle, no reflow → no flicker). */
.block-slider { position: relative; border-radius: 14px; overflow: hidden;
  margin: 0 0 44px; background: #eef1f4; }
.slider-viewport { display: grid; }
.block-slider .slide { grid-area: 1 / 1; opacity: 0; pointer-events: none;
  transition: opacity .7s ease-in-out; }
.block-slider .slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
.block-slider .slide img { width: 100%; display: block; object-fit: cover; }
/* Until images are preloaded, show the first slide and hide transitions so the
   page doesn't flash a half-loaded image. */
.block-slider:not(.is-ready) .slide { transition: none; }
.block-slider:not(.is-ready) .slide:first-child { opacity: 1; }
.slider-dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2;
  display: flex; justify-content: center; gap: 8px; }
.slider-dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .55); cursor: pointer; box-shadow: 0 0 2px rgba(0,0,0,.3); }
.slider-dot.is-active { background: #fff; }

/* configurable footer content (admin-authored HTML; line breaks preserved) */
.foot-text { color: inherit; white-space: pre-line; }
.foot-text a { color: inherit; text-decoration: underline; }
.foot-text img { max-width: 100%; height: auto; white-space: normal; }
.foot-text :is(h1, h2, h3, p, ul, div) { white-space: normal; }

/* image + text */
.block-imagetext { display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: center; }
.block-imagetext.is-right { direction: rtl; }
.block-imagetext.is-right > * { direction: ltr; }
.block-imagetext-media img { width: 100%; border-radius: 14px; display: block; }
.block-imagetext-copy h2 { font-size: 28px; margin: 0 0 12px; }

@media (max-width: 720px) {
  .block-banner { padding: 40px 24px; }
  .block-banner-inner h1 { font-size: 32px; }
  .block-imagetext { grid-template-columns: 1fr; }
}

/* ── Admin: structured block editor ── */
.block-editor { border: 1px solid #e4e7eb; border-radius: 8px; padding: 14px;
  margin: 12px 0 18px; background: #fbfcfd; }
.block-editor > h3 { margin: 0 0 10px; font-size: 15px; }
.be-block { border: 1px solid #d7dde3; border-radius: 8px; padding: 12px 14px;
  margin-bottom: 12px; background: #fff; }
.be-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.be-block-title { font-weight: 700; font-size: 13px; color: var(--brand, #2c3e50); flex: 1; }
.be-block-tools button { background: #eef2f5; border: 0; border-radius: 5px;
  width: 26px; height: 26px; cursor: pointer; margin-left: 4px; font-size: 13px; }
.be-block-tools button:hover { background: #dce3e9; }
/* Drag handle + collapse arrow */
.be-drag, .be-item-drag { cursor: grab; color: #9aa5b1; font-size: 15px; user-select: none; }
.be-drag:active, .be-item-drag:active { cursor: grabbing; }
.be-collapse { background: none; border: 0; cursor: pointer; font-size: 11px; color: #52606d;
  width: 20px; height: 22px; padding: 0; transition: transform .15s ease; }
.be-block.be-collapsed .be-collapse { transform: rotate(-90deg); }
.be-block.be-collapsed > *:not(.be-block-head) { display: none; }
.be-ghost { opacity: .45; background: #eaf3ff; }
.be-subitem { position: relative; border: 1px dashed #cbd2d9; border-radius: 6px;
  padding: 10px 36px 4px 30px; margin-bottom: 8px; background: #fcfdfe; }
.be-item-drag { position: absolute; top: 9px; left: 9px; }
.be-item-del { position: absolute; top: 8px; right: 8px; background: #eef2f5; border: 0;
  border-radius: 5px; width: 24px; height: 24px; cursor: pointer; line-height: 1; }
.be-item-del:hover { background: #f6d6d2; color: #c0392b; }
.be-item-add { margin-top: 2px; }
.be-add { display: flex; gap: 8px; align-items: center; }
.be-add-type { max-width: 240px; }
.src-pane { margin-top: 8px; }
.be-image-row { display: flex; gap: 8px; align-items: center; }
.be-image-url { flex: 1; }
.be-image-pick { white-space: nowrap; cursor: pointer; }
.be-image-preview { display: block; max-height: 120px; max-width: 100%; margin-top: 8px;
  border: 1px solid #e4e7eb; border-radius: 6px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid #eceff1; text-align: left; font-size: 14px; }
th { color: #52606d; font-weight: 600; }

/* Forms */
label { display: block; font-size: 13px; color: #52606d; margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 9px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; }
input[type=checkbox] { width: auto; }
.form-narrow { max-width: 440px; }
.inline { display: flex; gap: 8px; align-items: center; }
.qty { width: 70px; }

/* Flash */
.flash { padding: 11px 16px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.flash.success { background: #e3f9e5; color: #1a7f37; }
.flash.error { background: #fde8e8; color: #c0392b; }

/* Status pills */
.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #e4e7eb; color: #3e4c59; }
.pill.pending { background: #fff3cd; color: #8a6d00; }
.pill.approved, .pill.paid, .pill.pushed, .pill.confirmed { background: #e3f9e5; color: #1a7f37; }
.pill.rejected, .pill.failed { background: #fde8e8; color: #c0392b; }

/* Admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 220px; background: #1f2d3a; color: #cbd2d9; padding: 18px 0; }
.admin-side a { display: block; color: #cbd2d9; padding: 9px 22px; font-size: 14px; }
.admin-side a:hover, .admin-side a.active { background: #2c3e50; color: #fff; text-decoration: none; }
.admin-side .brandname { color: #fff; font-weight: 700; padding: 0 22px 14px; }
.admin-main { flex: 1; background: #f5f6f8; }
.admin-main .container { padding: 24px; max-width: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid #e4e7eb; border-radius: 8px; padding: 16px; }
.stat .n { font-size: 28px; font-weight: 700; color: var(--brand); }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* Image thumbnails (admin) */
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 5px; border: 1px solid #e4e7eb; background: #fff; }
.thumb-ph { width: 44px; height: 44px; border-radius: 5px; border: 1px dashed #cbd2d9; display: inline-flex;
  align-items: center; justify-content: center; color: #9aa5b1; font-size: 14px; }
.thumb-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid #e4e7eb; }
.media-grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* Simple tabs (admin) */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e4e7eb; margin-bottom: 18px; }
.tab-btn { background: none; border: none; padding: 10px 18px; font-size: 14px; cursor: pointer;
  color: #52606d; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn:hover { color: #1f2933; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-pane.hidden { display: none; }
