/* Speedy Shop: a full portal section. Colours come from the portal tokens in styles.css. */
.shop-root {
  --shop-line: #e4e7e5;
  --shop-muted: #52655c;
  --shop-accent: var(--action-text, #00805c);
  max-width: 1180px;
  color: #192921;
}
.shop-root [hidden] { display: none !important; }
.shop-root :is(button,input,textarea,select,[tabindex]):focus-visible { outline: 2px solid #006a4c; outline-offset: 3px; }
.shop-root h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.shop-root h4 { margin: 0; font-size: 15px; }
.shop-message { margin: 0; }
.shop-message:not(:empty) { margin: 0 0 14px; padding: 10px 13px; border-radius: 10px; background: #e9f3ee; color: #1f5a3c; font-size: 13px; }
.shop-message.shop-error:not(:empty) { background: #f1f2f3; color: var(--red, #c2184b); font-weight: 650; }
.shop-body > * + * { margin-block-start: 16px; }
.shop-busy .shop-body { cursor: progress; }
.shop-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.shop-section-heading p, .shop-stock p, .shop-order p { margin: 4px 0 0; color: var(--shop-muted); font-size: 13px; }
.shop-section-heading h3 .shop-state { margin-inline-start: 6px; }
.shop-heading-actions, .shop-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.shop-root .button { white-space: nowrap; }
.shop-root .button:disabled { opacity: .55; cursor: default; }

/* Forms */
.shop-body label { display: grid; gap: 6px; min-width: 0; color: #253a2f; font-size: 12px; font-weight: 650; }
.shop-body label small { color: var(--shop-muted); font-weight: 400; }
.shop-body :is(input:not([type="checkbox"]),textarea,select) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; border: 1px solid #ccd6cf; border-radius: 10px; background: #fff; color: #192921; font: inherit; font-size: 14px; font-weight: 400; padding: 9px 12px; }
.shop-body textarea { resize: vertical; }
.shop-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.shop-span { grid-column: 1/-1; }
.shop-form { display: grid; gap: 16px; }
.shop-body .shop-toggle { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; text-align: start; padding: 12px; border: 1px solid var(--shop-line); border-radius: 12px; }
.shop-toggle input { flex: none; width: 20px; height: 20px; accent-color: var(--action, #00c897); }
.shop-toggle strong, .shop-toggle small { display: block; }
.shop-toggle small { margin-top: 3px; }
.shop-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; color: var(--shop-muted); font-size: 13px; }
.shop-card { padding: 18px; border: 1px solid var(--shop-line); border-radius: 16px; background: #fff; }
.shop-card h4 { margin: 0 0 12px; }
.shop-card h4 + p { margin: -6px 0 12px; color: var(--shop-muted); font-size: 13px; }
.shop-card > p:last-child:not(.shop-hint) { margin: 10px 0 0; color: var(--shop-muted); font-size: 13px; }

/* Toolbars, filters and chips */
.shop-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--shop-line); border-radius: 14px; background: #fff; }
.shop-search { display: flex; flex: 1; align-items: end; gap: 10px; min-width: 0; }
.shop-search label { flex: 1; max-width: 460px; }
.shop-category-add { padding: 12px 14px; border: 1px solid var(--shop-line); border-radius: 14px; background: #fff; }
.shop-body .shop-sort { flex: none; width: 210px; }
.shop-filter { display: flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--shop-line); border-radius: 10px; background: var(--paper, #f8f9fa); }
.shop-filter button { min-height: 34px; padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--shop-muted); font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.shop-filter button[aria-pressed="true"] { background: #fff; color: #192921; box-shadow: 0 1px 2px #0f251d24; }
.shop-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.shop-chips button { flex: none; min-height: 36px; padding: 7px 14px; border: 1px solid var(--shop-line); border-radius: 9px; background: #fff; color: #253a2f; font: inherit; font-size: 13px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.shop-chips button:hover:not(:disabled) { border-color: #b9c4bd; }
.shop-chips button[aria-pressed="true"] { border-color: var(--action, #00c897); background: var(--action, #00c897); color: #fff; }

/* Solid squared tags */
.shop-state { display: inline-block; padding: 3px 8px; border-radius: 4px; background: #e9ecea; color: #33423b; font-size: 11px; font-weight: 750; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.shop-state-published { background: var(--action-text, #00805c); color: #fff; }
.shop-state-draft { background: #5f6d66; color: #fff; }
.shop-state-featured { background: #18231f; color: #fff; }
.shop-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.shop-badge { position: absolute; top: 10px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; line-height: 1.5; }
.shop-badge-sale { left: 10px; background: #18231f; color: #fff; }
.shop-badge-out { right: 10px; background: #5f6d66; color: #fff; }
.shop-price-line { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.shop-price-line strong { color: #192921; }
.shop-price-line s { color: var(--shop-muted); font-size: .86em; font-weight: 400; }
.shop-price-line:has(s) strong { color: var(--shop-accent); }

/* Lists */
.shop-list { display: grid; gap: 8px; }
.shop-empty { margin: 0; padding: 22px; border: 1px dashed #cfd6d1; border-radius: 13px; background: #fff; color: var(--shop-muted); font-size: 13px; }
.shop-more { display: flex; justify-content: center; }
.shop-listing { display: grid; grid-template-columns: 56px minmax(0,1fr) minmax(96px,auto) auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border: 1px solid var(--shop-line); border-radius: 13px; background: #fff; overflow-wrap: anywhere; }
.shop-listing:hover, .shop-category:hover { border-color: #cfd6d1; }
.shop-thumb { width: 56px; height: 56px; border-radius: 9px; background: #f2f3f4; overflow: hidden; }
.shop-thumb :is(img,.shop-photo-empty) { display: grid; width: 100%; height: 100%; object-fit: cover; font-size: 9px; text-align: center; }
.shop-photo-empty { display: grid; place-items: center; background: #f2f3f4; color: #a3ada7; }
.shop-photo-empty svg { width: 24px; height: 24px; }
.shop-listing-copy, .shop-category-name { display: grid; gap: 2px; min-width: 0; }
.shop-listing-copy p { margin: 0; color: var(--shop-muted); font-size: 13px; }
.shop-listing-copy small, .shop-category-name small { color: var(--shop-muted); font-size: 12px; }
.shop-listing-meta { display: grid; justify-items: end; gap: 5px; }
.shop-row-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.shop-row-actions .button { min-height: 36px; padding: 7px 12px; }
.shop-category { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border: 1px solid var(--shop-line); border-radius: 13px; background: #fff; }
.shop-category .shop-category-name { flex: 1; }
.shop-stock, .shop-order { display: grid; grid-template-columns: minmax(0,1fr) minmax(90px,auto) auto; gap: 14px; align-items: center; padding: 13px 16px; border: 1px solid var(--shop-line); border-radius: 13px; background: #fff; overflow-wrap: anywhere; }
.shop-order { grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) auto; font-size: 13px; }
.shop-quantity { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--shop-line); border-radius: 11px; background: #fff; }
.shop-quantity button { width: 38px; height: 36px; border: 0; border-radius: 8px; background: var(--paper, #f8f9fa); color: #253a2f; font: inherit; font-size: 17px; font-weight: 750; cursor: pointer; }
.shop-quantity button:disabled { opacity: .4; cursor: default; }
.shop-quantity strong { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.shop-totals { max-width: 460px; padding: 14px 16px; border: 1px solid var(--shop-line); border-radius: 13px; background: #fff; font-size: 13px; }
.shop-totals p { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; }
.shop-totals .button { margin-top: 8px; }

/* Shop home */
.shop-grid-title { margin-block-start: 22px; }
.shop-product-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,200px),1fr)); gap: 14px; }
.shop-product-grid > .shop-empty { grid-column: 1/-1; }
.shop-product { display: grid; align-content: start; border: 1px solid var(--shop-line); border-radius: 15px; background: #fff; overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.shop-product:hover { border-color: #c3cbc6; box-shadow: 0 8px 22px #1d2a2414; }
.shop-product-photo { position: relative; width: 100%; aspect-ratio: 4/3; background: #f2f3f4; overflow: hidden; }
.shop-product-photo > :is(img,.shop-photo-empty) { display: block; width: 100%; height: 100%; object-fit: cover; }
.shop-product-photo > .shop-photo-empty { display: grid; }
.shop-product.is-out .shop-product-photo > img { opacity: .5; filter: grayscale(.6); }
.shop-product-copy { display: grid; justify-items: start; gap: 5px; padding: 12px 13px 14px; }
.shop-product-copy small { color: var(--shop-muted); font-size: 11px; }
.shop-product-copy h4 { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.shop-featured { padding: 16px; border: 1px solid var(--shop-line); border-radius: 16px; background: #fff; }
.shop-featured h4 { margin-bottom: 12px; }
.shop-featured-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shop-featured-row .shop-product { flex: 0 0 210px; scroll-snap-align: start; }

/* Product page */
.shop-detail { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 24px; align-items: start; padding: 18px; border: 1px solid var(--shop-line); border-radius: 16px; background: #fff; }
.shop-gallery { display: grid; gap: 10px; min-width: 0; }
.shop-gallery-stage { position: relative; border-radius: 13px; background: #f2f3f4; overflow: hidden; }
.shop-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shop-gallery-track::-webkit-scrollbar { display: none; }
.shop-gallery-slide { flex: 0 0 100%; aspect-ratio: 4/3; scroll-snap-align: center; }
.shop-gallery-slide > :is(img,.shop-photo-empty) { display: block; width: 100%; height: 100%; object-fit: contain; }
.shop-gallery-slide > .shop-photo-empty { display: grid; }
.shop-gallery-arrow { position: absolute; top: 50%; width: 38px; height: 38px; margin-top: -19px; border: 1px solid var(--shop-line); border-radius: 50%; background: #fff; color: #192921; font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.shop-gallery-arrow.is-prev { left: 10px; }
.shop-gallery-arrow.is-next { right: 10px; }
.shop-gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.shop-gallery-thumbs button { flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: #f2f3f4; overflow: hidden; cursor: pointer; }
.shop-gallery-thumbs button[aria-pressed="true"] { border-color: var(--action, #00c897); }
.shop-gallery-thumbs :is(img,.shop-photo-empty) { display: block; width: 100%; height: 100%; object-fit: cover; font-size: 0; }
.shop-detail-copy { display: grid; gap: 14px; align-content: start; min-width: 0; }
.shop-price { font-size: 28px; letter-spacing: -.02em; }
.shop-description { margin: 0; color: #33423b; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.shop-buy { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--shop-line); }
.shop-buy p { margin: 0; color: var(--shop-muted); font-size: 13px; }
.shop-buy .shop-state { justify-self: start; }
.shop-buy .shop-actions { flex-wrap: nowrap; }
.shop-buy .button { min-height: 44px; }
.shop-related h4 { margin: 22px 0 12px; }

/* Listing editor */
.shop-editor { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 16px; align-items: start; }
.shop-image-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.shop-photo-tile { display: grid; gap: 5px; align-content: start; min-width: 0; }
.shop-body .shop-photo-tile label.shop-product-photo { position: relative; display: block; aspect-ratio: 4/3; border: 1px solid var(--shop-line); border-radius: 10px; cursor: pointer; }
.shop-body .shop-photo-tile label.shop-product-photo:has(.shop-photo-add) { border-style: dashed; border-color: #c3cbc6; background: var(--paper, #f8f9fa); }
.shop-body .shop-photo-tile label.shop-product-photo:hover { border-color: var(--shop-accent); }
.shop-body .shop-photo-tile label.shop-product-photo:focus-within { outline: 2px solid #006a4c; outline-offset: 3px; }
.shop-photo-add { display: grid; place-content: center; justify-items: center; gap: 5px; width: 100%; height: 100%; color: var(--shop-muted); font-size: 12px; font-weight: 650; }
.shop-photo-add svg { width: 22px; height: 22px; color: var(--shop-accent); }
.shop-body .shop-photo-tile input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.shop-photo-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--shop-muted); font-size: 12px; font-weight: 650; }
.shop-photo-actions button { padding: 4px 2px; border: 0; background: transparent; color: var(--red, #c2184b); font: inherit; font-weight: 700; cursor: pointer; }
.shop-photo-actions button:hover:not(:disabled) { text-decoration: underline; }
.shop-editor-actions { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 16px; border: 1px solid var(--shop-line); border-radius: 14px; background: #fff; box-shadow: 0 -6px 18px #1d2a240f; }
.shop-editor-actions p { flex: 1; min-width: 0; margin: 0; color: var(--shop-muted); font-size: 13px; }
.shop-editor-actions .button { min-height: 42px; }

@media (max-width: 760px) {
  .shop-fields, .shop-detail, .shop-editor { grid-template-columns: minmax(0,1fr); }
  .shop-toolbar { align-items: stretch; flex-direction: column; }
  .shop-body .shop-sort { width: auto; }
  .shop-filter { align-self: flex-start; max-width: 100%; overflow-x: auto; }
  .shop-listing { grid-template-columns: 56px minmax(0,1fr); }
  .shop-listing-meta { grid-column: 1/-1; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: start; }
  .shop-tags { justify-content: flex-start; }
  .shop-listing > .shop-row-actions { grid-column: 1/-1; }
  .shop-listing > .shop-row-actions .button { flex: 1; }
  .shop-category { align-items: stretch; flex-direction: column; }
  .shop-category .shop-row-actions { justify-content: flex-start; }
  .shop-stock, .shop-order { grid-template-columns: minmax(0,1fr) auto; }
  .shop-stock > .button, .shop-order > strong { grid-column: 1/-1; justify-self: start; }
  .shop-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .shop-featured-row .shop-product { flex-basis: 168px; }
  .shop-detail { padding: 12px; }
  .shop-buy .shop-actions { flex-wrap: wrap; }
  .shop-buy .button { flex: 1; }
  .shop-editor-actions p { flex-basis: 100%; }
  .shop-editor-actions .button { flex: 1; }
  .shop-body :is(input:not([type="checkbox"]),textarea,select) { font-size: 16px; }
}

/* Shop home: banners, category tiles, product rows, quick add and the cart bar */
.shop-root { position: relative; }
.shop-banners { display: grid; gap: 8px; }
.shop-banner-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 20px; }
.shop-banner-track::-webkit-scrollbar { display: none; }
.shop-banner { flex: 0 0 100%; aspect-ratio: 2.2; max-height: 340px; padding: 0; border: 0; border-radius: 20px; background: #0a3a2e; overflow: hidden; scroll-snap-align: center; }
button.shop-banner { cursor: pointer; }
.shop-banner > :is(img,.shop-photo-empty) { display: block; width: 100%; height: 100%; object-fit: cover; }
.shop-banner > .shop-photo-empty { display: grid; background: #0a3a2e; color: #c9efe3; }
.shop-banner-dots { display: flex; justify-content: center; gap: 6px; }
.shop-banner-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 8px; background: #d5dad7; cursor: pointer; transition: width .2s; }
.shop-banner-dots button[aria-pressed="true"] { width: 22px; background: var(--action, #00c897); }
.shop-tiles { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.shop-tile { flex: 0 0 96px; display: grid; justify-items: center; gap: 6px; padding: 4px; border: 0; border-radius: 16px; background: transparent; color: #192921; font: inherit; font-size: 12px; font-weight: 650; line-height: 1.3; text-align: center; cursor: pointer; }
.shop-tile-photo { width: 76px; height: 76px; border: 1px solid var(--shop-line); border-radius: 20px; background: #fff; overflow: hidden; }
.shop-tile-photo > :is(img,.shop-photo-empty) { display: grid; width: 100%; height: 100%; object-fit: cover; }
.shop-tile:hover .shop-tile-photo { border-color: var(--action, #00c897); }
.shop-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.shop-row-heading .button { min-height: 34px; padding: 6px 12px; border-color: transparent; background: transparent; color: var(--shop-accent); }
.shop-row-heading .shop-grid-title { margin: 0; }
.shop-row { display: grid; gap: 8px; }
.shop-product { border-radius: 20px; }
.shop-product-photo { aspect-ratio: 1; }
.shop-quick-add { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--action, #00c897); color: #fff; box-shadow: 0 4px 12px #0033251f; cursor: pointer; }
.shop-quick-add svg { width: 20px; height: 20px; }
.shop-quick-add:hover:not(:disabled) { background: var(--action-hover, #00b285); }
.shop-quick-add:disabled { opacity: .45; cursor: default; }
.shop-badge-cart { top: auto; bottom: 10px; left: 10px; background: var(--action-text, #00805c); color: #fff; }
.shop-skeleton { cursor: default; pointer-events: none; }
.shop-skeleton .shop-product-photo { background: #eceeed; }
.shop-skeleton i { display: block; height: 12px; border-radius: 6px; background: #eceeed; }
.shop-skeleton i:nth-child(1) { width: 85%; }
.shop-skeleton i:nth-child(2) { width: 50%; }
.shop-skeleton i:nth-child(3) { width: 64px; height: 15px; }
.shop-empty-state { display: grid; justify-items: center; gap: 8px; padding: 36px 16px; border: 1px dashed #cfd6d1; border-radius: 20px; background: #fff; text-align: center; }
.shop-empty-state p { max-width: 420px; margin: 0; color: var(--shop-muted); font-size: 13px; }
.shop-empty-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--orange-soft, #e5f9f4); color: var(--shop-accent); }
.shop-empty-icon svg { width: 28px; height: 28px; }
.shop-cart-bar { position: sticky; bottom: 14px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(100%, 520px); min-height: 52px; margin: 18px auto 0; padding: 12px 20px; border: 0; border-radius: 20px; background: var(--action, #00c897); color: #fff; font: inherit; font-size: 14px; font-weight: 750; box-shadow: 0 10px 28px #00332533; cursor: pointer; }
.shop-cart-bar:hover { background: var(--action-hover, #00b285); }
.shop-banner-row { display: grid; grid-template-columns: 132px minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border: 1px solid var(--shop-line); border-radius: 13px; background: #fff; }
.shop-banner-thumb { width: 132px; aspect-ratio: 2.2; border-radius: 10px; background: #f2f3f4; overflow: hidden; }
.shop-banner-thumb > :is(img,.shop-photo-empty) { display: grid; width: 100%; height: 100%; object-fit: cover; font-size: 11px; }
.shop-body label.shop-file-button { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; overflow: hidden; }
.shop-body label.shop-file-button input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.shop-body label.shop-file-button:focus-within { outline: 2px solid #006a4c; outline-offset: 3px; }
.shop-body input[type="file"][name="image"] { padding: 8px; }
@media (max-width: 760px) {
  .shop-banner-row { grid-template-columns: 104px minmax(0,1fr); }
  .shop-banner-thumb { width: 104px; }
  .shop-banner-row > .shop-listing-meta, .shop-banner-row > .shop-row-actions { grid-column: 1/-1; }
  .shop-banner-row > .shop-row-actions { flex-wrap: wrap; justify-content: flex-start; }
  .shop-cart-bar { bottom: 84px; }
}
