/* Hierarquia, campos e dialogs do catálogo; os temas fornecem as cores. */
.products-manager, .product-dialog { --product-space: 24px; --product-radius: 16px; }
.products-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.products-heading h1 { margin: 6px 0 10px; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: -.04em; }
.products-heading p:last-child { margin: 0; color: var(--muted); line-height: 1.6; max-width: 60ch; }
.products-manager button, .products-manager summary, .product-dialog button, .product-dialog input, .product-dialog select, .product-buy-button { min-height: 44px; }
.products-sales-card { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr); align-items: start; gap: 28px; padding: 24px; border: 1px solid var(--line); border-radius: var(--product-radius); background: var(--surface); }
.products-sales-intro { display: flex; gap: 14px; align-items: start; }
.products-sales-icon { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font-size: 1.25rem; }
.products-sales-intro h2 { font-size: 1.05rem; margin: 0 0 7px; }
.products-sales-intro p { font-size: .9375rem; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.product-status { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; color: var(--text); background: var(--surface); font-size: .8125rem; font-weight: 600; line-height: 1.35; }
.products-manager #sales-whatsapp-form { max-width: none; gap: 8px; }
.products-manager #sales-whatsapp-form > label { font-size: .875rem; font-weight: 600; }
.products-phone-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.products-phone-control input { margin: 0; min-width: 0; width: 100%; font-size: 1rem; font-variant-numeric: tabular-nums; }
.products-help { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
#sales-phone-feedback, #products-feedback { margin: 0; font-size: .875rem; line-height: 1.5; }
#products-feedback:empty, #sales-phone-feedback:empty { display: none; }
.products-collection-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.products-collection-heading p { margin: 0; color: var(--muted); font-size: .9375rem; }
.products-collection-heading strong { color: var(--text); }
.products-collection-heading a { color: var(--text); text-decoration: none; font-size: .875rem; display: inline-flex; gap: 10px; align-items: center; min-height: 44px; }
.products-collection-heading a:hover { text-decoration: underline; }
.product-manager-card { padding: 0; border: 1px solid var(--line); border-radius: var(--product-radius); background: var(--surface); }
.product-manager-image { position: relative; }
.product-manager-image > img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 15px 15px 0 0; background: var(--bg-soft); }
.product-manager-image .product-status { position: absolute; top: 12px; left: 12px; background: var(--modal-bg); }
.product-manager-copy { padding: 20px; }
.product-manager-copy h2 { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 600; line-height: 1.45; }
.product-manager-price { margin: 0; font-weight: 650; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.product-manager-description { margin: 12px 0 20px; color: var(--muted); font-size: .875rem; line-height: 1.5; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.product-manager-footer { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.product-manager-footer > span { color: var(--muted); font-size: .8125rem; }
.product-manager-footer .products-actions { gap: 8px; }
.product-manager-footer button { font-size: .8125rem; padding: 8px 12px; }
.product-action-menu { position: relative; }
.product-action-menu summary { list-style: none; display: grid; place-items: center; width: 44px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 700; }
.product-action-menu summary::-webkit-details-marker { display: none; }
.product-action-menu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; padding: 6px; min-width: 210px; border: 1px solid var(--line); background: var(--modal-bg); border-radius: 12px; box-shadow: 0 10px 32px rgb(0 0 0 / .18); }
.product-action-menu > div button { background: transparent; border: 0; color: var(--text); text-align: left; box-shadow: none; }
.product-action-menu > div button:hover { background: var(--soft-hover); transform: none; }
.product-action-menu > div .product-delete-action { color: var(--danger); }
.products-empty { display: grid; justify-items: center; text-align: center; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: 16px; }
.products-empty > span { font-size: 2rem; color: var(--muted); }
.products-empty h2 { margin: 16px 0 8px; font-size: 1.3rem; }
.products-empty p { color: var(--muted); max-width: 44ch; line-height: 1.6; margin: 0 0 24px; }
.product-dialog { background: var(--modal-bg, var(--surface)); border-radius: 20px; box-shadow: 0 24px 80px rgb(0 0 0 / .35); padding: 0; width: min(960px, calc(100% - 40px)); max-height: calc(100dvh - 48px); }
.product-dialog:not([open]) { display: none; }
.product-dialog-heading { padding: 24px 28px; margin: 0 !important; border-bottom: 1px solid var(--line); align-items: start !important; }
.product-dialog-heading h2 { margin: 4px 0 8px; font-size: 1.5rem; line-height: 1.25; letter-spacing: -.025em; }
.product-dialog-heading .eyebrow { margin: 0; }
.product-dialog-heading p:last-child:not(.eyebrow), .product-dialog-context { font-size: .875rem; color: var(--muted); line-height: 1.5; }
.product-dialog-heading p:last-child:not(.eyebrow) { margin: 0; }
.product-dialog-context { display: block; margin-top: 6px; }
.product-dialog .product-close-button { background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); border-radius: 50%; padding: 0; width: 44px; height: 44px; flex-shrink: 0; font-size: 1.5rem; line-height: 1; box-shadow: none; }
.product-dialog .product-close-button:hover { background: var(--soft-hover); transform: none; }
.product-editor { max-width: 960px; overflow: hidden; }
.product-editor[open] { display: flex; flex-direction: column; }
.product-editor form { display: flex; flex-direction: column; gap: 0; min-height: 0; }
.product-editor-body { padding: 28px; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; }
.product-editor-information { display: grid; gap: 20px; align-content: start; min-width: 0; }
.product-editor-information h3 { font-size: .9375rem; margin: 0; }
.product-editor label { font-size: .875rem; font-weight: 600; position: relative; }
.product-editor label small { font-size: .8125rem; color: var(--muted); font-weight: 400; line-height: 1.5; }
.product-editor label .products-optional { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.product-editor input, .product-editor select, .product-editor textarea { margin: 0; font-size: 1rem; border-radius: 10px; }
.product-editor input[name="price"] { font-variant-numeric: tabular-nums; }
.product-editor textarea { resize: vertical; min-height: 120px; }
.product-editor-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.product-editor .product-editor-media { padding: 0; margin: 0; border: 0; min-width: 0; }
.product-editor-media legend { font-weight: 600; font-size: .9375rem; padding: 0; }
.product-editor-media > p { margin: 8px 0 16px; font-size: .875rem; color: var(--muted); line-height: 1.6; }
.product-editor .product-upload-target { border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--bg-soft); display: grid; justify-items: center; gap: 8px; text-align: center; padding: 24px 14px; cursor: pointer; }
.product-upload-target > span:first-child { font-size: 1.75rem; font-weight: 400; line-height: 1; }
.product-upload-target > span:last-of-type { font-size: .8125rem; font-weight: 400; color: var(--muted); }
.product-upload-target input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.product-upload-target:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.product-editor-images { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-editor-images span { font-size: .8125rem; }
.product-editor-images button { font-size: .75rem; padding: 8px; background: transparent; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.product-editor-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; border-top: 1px solid var(--line); background: var(--modal-bg); }
#product-editor-feedback { margin: 0; flex: 1 1 200px; font-size: .875rem; line-height: 1.5; }
#product-price-error:empty { display: none; }
.public-product-dialog { overflow: hidden; }
.public-product-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.public-product-detail { padding: 28px; gap: 32px; overflow-y: auto; min-height: 0; }
.product-image-stage { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); overflow: hidden; }
.product-image-stage img { display: block; width: 100%; height: min(48vh, 390px); object-fit: contain; }
.product-detail-copy { padding: 12px 0; min-width: 0; }
.product-detail-copy .eyebrow { margin: 0 0 10px; }
.product-detail-copy h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -.03em; margin: 0 0 24px; }
.product-description-block h3 { font-size: .875rem; font-weight: 600; margin: 0 0 10px; }
.product-description { font-size: 1rem; line-height: 1.75; margin: 0; }
.product-detail-note { font-size: .875rem; line-height: 1.6; color: var(--muted); padding-top: 20px; margin: 24px 0 0; border-top: 1px solid var(--line); }
.product-gallery-controls { gap: 12px; margin-top: 12px; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.product-gallery-controls button { width: 44px; padding: 8px; }
.product-gallery-thumbnails { gap: 8px; }
.product-gallery-thumbnails button { border-color: var(--line); box-shadow: none; }
.product-purchase-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 20px 28px; border-top: 1px solid var(--line); background: var(--modal-bg); }
.product-purchase-bar > div { display: grid; gap: 4px; }
.product-purchase-bar > div > span { font-size: .8125rem; color: var(--muted); }
.product-purchase-bar strong { font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.product-purchase-bar .product-buy-button { margin: 0; font-size: .9375rem; min-height: 48px; }
.product-purchase-bar .product-unavailable { font-size: .875rem; margin: 0; }
.products-manager :is(button, summary, a):focus-visible, .product-dialog :is(button, a, input, textarea, select):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 760px) {
  .products-sales-card { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .product-editor-body { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .product-editor-information { gap: 18px; }
}
@media (max-width: 640px) {
  .products-heading { align-items: start; gap: 18px; }
  .products-heading > .products-actions { width: 100%; }
  .products-heading > .products-actions > button:last-child { flex: 1; }
  .products-sales-card { padding: 20px; }
  .products-phone-control { grid-template-columns: minmax(0, 1fr); }
  .product-manager-copy { padding: 16px; }
  .product-manager-footer { align-items: start; }
  .product-manager-footer > .products-actions { width: 100%; }
  .product-manager-footer [data-edit] { flex: 1; }
  .product-dialog { width: 100%; margin: 0; inset: 0; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .product-dialog-heading { padding: max(18px, env(safe-area-inset-top)) 20px 18px; }
  .product-editor-body, .public-product-detail { padding: 20px; gap: 24px; }
  .product-editor-footer { padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
  .product-editor-footer .products-actions { flex: 1 1 100%; }
  .product-editor-footer .products-actions button { flex: 1; }
  .product-editor-information label { font-size: .9375rem; }
  .public-product-detail { grid-template-columns: minmax(0, 1fr); }
  .product-image-stage img { height: min(40vh, 320px); }
  .product-detail-copy { padding: 0; }
  .product-detail-copy h2 { font-size: 1.5rem; margin-bottom: 20px; }
  .product-purchase-bar { padding: 16px 20px max(18px, env(safe-area-inset-bottom)); gap: 12px; }
  .product-purchase-bar strong { font-size: 1.25rem; }
  .product-purchase-bar .product-buy-button { flex: 1 1 100%; }
  .product-purchase-bar .product-unavailable { flex: 1 1 100%; }
}
@media (max-width: 380px) { .product-editor-fields { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-contrast: more) { .product-dialog, .product-manager-card, .products-sales-card { border-color: var(--text); } .product-dialog :is(small, .products-help), .products-manager .products-help { color: var(--text); } }
@media (prefers-reduced-motion: reduce) { .products-manager *, .product-dialog * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (max-width: 640px) { .products-manager .product-grid { grid-template-columns: minmax(0, 1fr); } }
.product-dialog-heading, .product-editor-footer { flex-shrink: 0; }
.product-editor form { flex: 1; overflow: hidden; }
.product-editor-body { flex: 1; min-height: 0; }
.product-action-menu > div .product-delete-action { color: var(--text); }
.product-editor-body, .public-product-detail { overscroll-behavior: contain; }
.products-manager .products-actions button, .product-editor-footer .products-actions button { width: auto; }
.product-add-icon { display: inline-flex; align-items: center; vertical-align: middle; }
.product-editor :is(input, select, textarea) { font-weight: 400; }
.product-gallery-thumbnails:empty { display: none; }
@media (max-width: 640px) { .product-dialog { max-width: 100%; } }
.products-manager label, .product-editor label { margin-bottom: 0; }
.products-manager .secondary-button, .product-dialog .secondary-button { margin-top: 0; }
:root[data-custom-theme="true"] :is(.products-manager, .product-dialog) { --modal-bg: var(--surface); --input-bg: var(--surface); --input-focus-bg: var(--surface); }
