/* Manager workspace */
.shop-page {
  --bg: #f0ecdf;
  --surface: #fffcf4;
  --text: #271f1a;
  --muted: #62564d;
  --border: #d7cdba;
  --accent: #773c33;
  background: var(--bg);
  color: var(--text);
}
.shop-page main { width: min(100% - 48px, 1180px); max-width: none; }
.shop-topbar, .shop-topbar nav { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; }
.shop-topbar { justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.shop-brand { font: 700 1.4rem Georgia, serif; color: var(--accent); }
.shop-heading { font: 700 clamp(2.35rem, 5vw, 4.65rem)/1 Georgia, serif; letter-spacing: -.045em; max-width: 13em; margin: 1rem 0 .45rem; }
.shop-intro { margin: 0; color: var(--muted); line-height: 1.5; }
.shop-link { color: var(--accent); text-underline-offset: .2em; }
.shop-page .panel { background: var(--surface); border-radius: 12px; box-shadow: none; min-width: 0; }
.shop-page h2, .shop-page h3 { font-family: Georgia, serif; }
.shop-page button:not(.secondary) { background: var(--accent); border-color: var(--accent); }
.shop-page button:not(.secondary):hover:not(:disabled) { background: #5b2b24; }
.secondary { background: #f2e7db; color: #582e29; border-color: #d8c3ad; }
.secondary:hover:not(:disabled) { background: #e9d8c7; }
.shop-page { min-height: 100vh; display: flow-root; }
.shop-page main { margin-top: clamp(18px, 4vw, 48px); }
.shop-heading { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 22em; }
.manager-orders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: .85rem; }
.manager-orders p { overflow-wrap: anywhere; }
.manager-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 490px) {
  .shop-page main { width: min(100% - 24px, 1180px); }
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("storefront/cormorant-garamond.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Golos Text";
  src: url("storefront/golos-text.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url("storefront/roboto.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

.storefront {
  --bg: #f8f5ec;
  --surface: #fffdf8;
  --text: #262923;
  --muted: #5e6256;
  --border: #d9d4c7;
  --accent: #6d302a;
  --accent-soft: #f4e7df;
  --heading-font: "Cormorant Garamond", Georgia, serif;
  background: var(--bg);
  color: var(--text);
  font: 13px "Golos Text", sans-serif;
  min-height: 100vh;
}

.storefront main {
  display: grid;
  gap: 20px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 40px;
}

.storefront button { min-height: 38px; border-radius: 10px; padding: 10px 14px; }
.storefront button:hover:not(:disabled) { background: #572620; }
.storefront .secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 400;
}
.storefront .secondary:hover:not(:disabled) { background: var(--accent-soft); }
.storefront :focus-visible { outline-offset: 2px; }
.storefront a { color: var(--accent); }
.storefront .mobile-title { display: none; }

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin: 0;
}
.catalog-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 100px;
  text-decoration: none;
}
.catalog-brand strong { display: block; font: 700 34px var(--heading-font); margin-bottom: -2px; }
.catalog-brand small { display: block; font-size: 11px; color: #494439; }
.catalog-actions { display: flex; gap: 8px; }
.catalog-page { display: grid; gap: inherit; }
.catalog-search { display: flex; flex: 1 1 220px; gap: 8px; min-width: 0; max-width: 420px; }
.catalog-search input { min-height: 38px; border-radius: 10px; }
#shop-cart-open {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
#shop-cart-open:hover { background: #572620; }

.catalog-categories, .catalog-category-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.storefront [data-category] {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  min-height: 32px;
  font-size: 12px;
  font-weight: 400;
}
.storefront [data-category]:hover:not(:disabled), .storefront [data-category][aria-pressed="true"] { background: transparent; color: var(--accent); }
.storefront [data-category][aria-pressed="true"] { font-weight: 700; }
.catalog-categories .catalog-sections { width: 109px; height: 32px; min-height: 32px; padding: 0; font-size: 12px; font-weight: 700; }
.catalog-heading h1 { margin: 0 0 2px; letter-spacing: normal; font: 700 58px/70px var(--heading-font); }
.catalog-heading p { color: var(--muted); font-size: 15px; line-height: 18px; margin: 0; }

.catalog-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
#shop-catalog-count { margin: 0; color: var(--muted); }
.catalog-sort { position: relative; }
.catalog-sort > summary { cursor: pointer; list-style: none; border-radius: 10px; width: 115px; text-align: center; padding: 10px 0; line-height: 16px; }
.catalog-sort > summary span::after { content: "▾"; }
.catalog-sort[open] > summary span::after { content: "▴"; }
.catalog-sort-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px;
  width: min(242px, calc(100vw - 36px));
}
.catalog-sort-options button {
  width: 100%;
  min-height: 40px;
  text-align: left;
  background: transparent;
  color: var(--text);
  font-weight: 400;
  padding: 10px 12px;
}
.catalog-sort-options button:hover:not(:disabled), .catalog-sort-options button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.catalog-sort-options button[aria-pressed="true"] {
  background-image: url("storefront/sort-selected.svg");
  background-position: right 12px center;
  background-repeat: no-repeat;
  font-weight: 700;
}

#shop-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
#shop-catalog:empty, #shop-catalog-status:empty, #shop-feedback:empty, #shop-chat-feedback:empty { display: none; }
.shop-product { display: flex; flex-direction: column; align-items: start; gap: 9px; }
.shop-product-image { position: relative; width: 100%; aspect-ratio: 320 / 286; overflow: hidden; background: var(--surface); }
.shop-product-image img { position: absolute; display: block; max-width: none; }
.shop-product-image img.shop-direct-photo { width: 100%; height: 100%; object-fit: cover; }
.shop-product-image[data-image="tile"] img { width: 300%; top: -61.89%; left: 0; }
.shop-product-image[data-image="plaster"] img, .shop-product-image[data-image="wool"] img { width: 200%; top: -24.59%; }
.shop-product-image[data-image="plaster"] img { left: 0; }
.shop-product-image[data-image="wool"] img { left: -100%; }
.shop-product-image[data-catalog-photo] {
  --photo-inset: 2.5%;
  background-image: url("storefront/catalog-materials.png");
  background-size: 300% auto;
  background-repeat: no-repeat;
}
.shop-product-image[data-catalog-photo="sand-tile"] { background-position: left var(--photo-inset); }
.shop-product-image[data-catalog-photo="white-tile"] { background-position: center var(--photo-inset); }
.shop-product-image[data-catalog-photo="paint"] { background-position: right var(--photo-inset); }
.shop-product-image[data-catalog-photo="screws"] { background-position: left center; }
.shop-product-image[data-catalog-photo="drill"] { background-position: center; }
.shop-product-image[data-catalog-photo="faucet"] { background-position: right center; }
.shop-product-image[data-catalog-photo="socket"] { background-position: left calc(100% - var(--photo-inset)); }
.shop-product-image[data-catalog-photo="brick"] { background-position: center calc(100% - var(--photo-inset)); }
.shop-product-image[data-catalog-photo="cement"] { background-position: right calc(100% - var(--photo-inset)); }
.shop-product-body { display: grid; gap: 6px; flex: 1; align-content: start; }
.shop-product-body p { margin: 0; }
.shop-product h3 { font: 700 20px/24px var(--heading-font); margin: 0; overflow-wrap: anywhere; }
.shop-product-caption, .shop-product-stock { color: var(--muted); font-size: 11px; line-height: 13px; }
.shop-product-price { font-size: 12px; line-height: 14px; }

.shop-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.storefront .shop-chat-launcher {
  position: fixed;
  inset: auto max(26px, calc((100% - 1080px) / 2 + 26px)) 24px auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 1px solid #e7e1d5;
  border-radius: 50%;
  box-shadow: 0 10px 11px #34251929;
}
.storefront .shop-chat-launcher[aria-expanded="true"] { visibility: hidden; }

.shop-drawer {
  position: fixed;
  inset: 20px 20px auto auto;
  margin: 0;
  padding: 18px;
  width: min(336px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.shop-drawer::backdrop { background: transparent; }
.shop-drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 13px;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
.shop-drawer-heading h2 { margin: 0; font: 700 36px var(--heading-font); }
.storefront .shop-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: 400 24px/1 Roboto, sans-serif;
}
.storefront .shop-close:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
#shop-sections { width: min(356px, calc(100% - 40px)); }
#shop-sections h2 { font-size: 33px; }
#shop-section-groups section + section { border-top: 1px solid var(--border); padding-top: 13px; margin-top: 13px; }
.shop-category-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.shop-category-group h3 { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.shop-category-group [data-category] { min-height: 0; text-align: left; }
#shop-filter-form { display: grid; gap: 13px; }
#shop-filter-form legend { font-weight: 700; font-size: 14px; margin-bottom: 13px; padding: 0; }
.shop-filter-prices { display: flex; gap: 12px; }
.shop-filter-prices input { width: 72px; min-height: 38px; }
.storefront input { border-color: var(--border); background: var(--surface); }
#shop-filter-groups { display: grid; gap: 11px; font-size: 11px; }
#shop-filter-groups h3 { font-size: 11px; }
#shop-filter-groups .shop-category-group { gap: 4px 9px; }
#shop-filter-form label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: inherit; font-weight: 400; }
#shop-filter-form input[type="checkbox"] { width: 12px; min-height: 0; margin: 0; accent-color: var(--accent); }
#shop-filter-form details:first-of-type, .shop-filter-actions { border-top: 1px solid var(--border); padding-top: 13px; }
#shop-filter-form summary { cursor: pointer; list-style: none; }
#shop-filter-form summary::after { content: "＋"; margin-left: 6px; }
#shop-filter-form details[open] summary::after { content: "−"; }
.shop-filter-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.shop-cart-return { display: inline-block; margin-bottom: 12px; text-underline-offset: .2em; }
.shop-cart-page h1 { margin: 0 0 24px; letter-spacing: normal; font: 700 58px/1.1 var(--heading-font); }
.shop-cart-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; gap: 24px; }
.shop-cart-items { min-width: 0; }
.shop-cart-product {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 18px 0;
  border-block: 1px solid var(--border);
}
.shop-cart-image .shop-product-image { border-radius: 10px; }
#shop-basket h3, .shop-order h2 { margin: 0; font: 700 23px var(--heading-font); }
.shop-cart-article { color: var(--muted); margin: 0 0 6px; font-size: 12px; }
.shop-quantity-controls { display: grid; grid-template-columns: 38px 44px 38px; }
.shop-quantity-controls input {
  min-height: 38px;
  border-inline: 0;
  border-radius: 0;
  padding: 0;
  text-align: center;
  appearance: textfield;
}
.shop-quantity-controls input::-webkit-inner-spin-button { appearance: none; }
.shop-quantity-controls button:first-child { border-radius: 10px 0 0 10px; }
.shop-quantity-controls button:last-child { border-radius: 0 10px 10px 0; }
.shop-cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.shop-cart-summary p:first-child { margin: 0; color: var(--muted); }
.shop-cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; }
.shop-cart-total h2 { margin: 0; font: 700 30px var(--heading-font); }
.shop-cart-total strong { font-size: 23px; }
.shop-cart-summary > button, .shop-order button { width: 100%; }
#shop-basket-empty, .shop-cart-meta, .shop-cart-stats dt { color: var(--muted); }
.shop-cart-stats { display: grid; grid-template-columns: 1fr auto; gap: 13px; margin: 13px 0; }
.shop-cart-stats dd { text-align: right; margin: 0; font-size: 14px; }
.shop-shortage { padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
#shop-find-alternative, #shop-alternatives button { width: 100%; border-radius: 12px; }
#shop-find-alternative { margin-top: 13px; }
#shop-alternatives:not(:empty), .shop-order { border-top: 1px solid var(--border); margin-top: 13px; padding-top: 13px; }
#shop-alternatives h3 { font-size: 20px; }
.shop-order p { overflow-wrap: anywhere; }
#shop-accessories:not([hidden]) { margin-top: 20px; }
.shop-accessory {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--surface);
}
.shop-accessory input { width: 100%; }
#shop-save { margin-top: 13px; }
#shop-payment-link:not([hidden]) {
  display: block;
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #682e28;
  color: #fff;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
}
#shop-payment-link:hover { background: #572620; }

.storefront .shop-help {
  --chat-surface: #fff;
  --chat-text: #1b2430;
  --chat-border: #d7dde6;
  --chat-rule: #d7dde6;
  --chat-bubble: #f0f3f7;
  --chat-placeholder: #4a5768;
  --chat-radius: 12px;
  position: fixed;
  inset: auto max(26px, calc((100% - 1080px) / 2 + 26px)) 24px auto;
  z-index: 3;
  width: min(360px, calc(100% - 32px));
  height: 264px;
  max-height: calc(100dvh - 48px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  color-scheme: only light;
  background: var(--chat-surface);
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  font: 14px Roboto, sans-serif;
}
.shop-help[open] { display: flex; flex-direction: column; }
.storefront .shop-help[data-conversation] {
  height: 440px;
}
.shop-help-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--chat-rule);
}
.shop-help-bar h2 { font: 700 17px Roboto, sans-serif; margin: 0; }
.shop-help[data-conversation] h2 { font-size: 16px; }
.shop-chat-history {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
#shop-messages { display: grid; gap: 8px; width: 100%; }
#shop-messages p {
  margin: 0;
  border-radius: 12px;
  padding: 8px 10px;
  width: min(288px, 100%);
  overflow-wrap: anywhere;
  background: var(--chat-bubble);
}
.shop-help[data-conversation] #shop-messages p { border-radius: 11px; }
#shop-messages .buyer { background: var(--accent); color: #fff5f0; justify-self: end; }
#shop-chat-feedback { margin: 0; }
#shop-quote-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  border-color: var(--chat-border);
  color: var(--chat-text);
  text-decoration: none;
}
#shop-quote-link:hover { text-decoration: underline; }
.chat-controls { display: flex; align-items: stretch; gap: 8px; }
#shop-chat { border-top: 1px solid var(--chat-rule); padding: 8px 10px; }
#shop-chat input, #shop-chat button { height: 44px; border-radius: var(--chat-radius); padding: 0 11px; }
#shop-chat input { background: transparent; border-color: var(--chat-border); }
#shop-chat input::placeholder { color: var(--chat-placeholder); opacity: 1; }
#shop-model-status { margin: 4px 0 0; }

@media (max-width: 760px) {
  .catalog-search { order: 1; flex-basis: 100%; max-width: none; }
  .shop-cart-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .storefront .desktop-title, .catalog-category-links { display: none; }
  .storefront .mobile-title { display: inline; }
  .storefront main { gap: 14px; padding: 18px; }
  .catalog-header { padding-bottom: 14px; }
  .catalog-actions .shop-help-trigger { padding-inline: 8px; }
  .catalog-categories { justify-content: space-between; }
  .storefront [data-category=""] { font-size: 13px; }
  .catalog-heading h1 { font-size: 45px; line-height: 54px; margin-bottom: 3px; }
  .catalog-heading p { font-size: 13px; line-height: 16px; }
  .shop-cart-page h1 { font-size: 45px; }
  .shop-cart-product { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  #shop-quantity { grid-column: 2; }
  .catalog-toolbar { grid-template-columns: 1fr auto; }
  .catalog-toolbar > button { justify-self: start; }
  #shop-catalog-count { grid-row: 2; font-size: 12px; }
  #shop-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .shop-product-image { aspect-ratio: 155 / 152; }
  .shop-product-image[data-catalog-photo] { --photo-inset: .5%; }
  .shop-product-image[data-image="tile"] img { top: -51.97%; }
  .shop-product-image[data-image="plaster"] img, .shop-product-image[data-image="wool"] img { top: -17.98%; }
  .storefront .shop-chat-launcher, .storefront .shop-help { right: 16px; bottom: 16px; }
  .storefront .shop-help { max-height: calc(100dvh - 32px); }
}
