/* P2-C1/C2 — Catálogo no padrão Fresha (Serviços .cat-svc, Produtos .cat-prd). Toda regra presa a .cat */
.cat { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; padding: 20px 16px; }
.cat .cat-svc, .cat .cat-prd, .cat .cat-pkg { min-width: 0; max-width: 100%; }
.cat .cat-tabs { display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; margin-bottom: 20px; width: 100%; max-width: 100%; box-sizing: border-box; }
.cat .cat-tabs::-webkit-scrollbar { display: none; }
.cat .cat-tab { flex: 0 0 auto; white-space: nowrap; box-sizing: border-box; height: 38px; padding: 0 16px; font-size: 14px; font-weight: 500; line-height: 1; border-radius: var(--r-pill, 9999px); border: 1px solid var(--border-input); background: transparent; color: var(--text-muted); cursor: pointer; }
.cat .cat-tab[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; }
.cat .cat-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.cat .cat-head h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 700; color: var(--text); }
.cat [data-cat-resumo] { margin-top: 4px; font-size: 15px; color: var(--text-muted); }
.cat .cat-head #new, .cat .cat-head #newpkg { box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 18px; font-size: 14px; font-weight: 600; border-radius: var(--r-pill, 9999px); border: 0; background: var(--btn-bg); color: var(--btn-fg); cursor: pointer; }
.cat .cat-svc .cat-table-wrap, .cat .cat-prd .cat-table-wrap, .cat .cat-pkg .cat-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.cat .cat-svc table, .cat .cat-prd table, .cat .cat-pkg table { width: 100%; border-collapse: collapse; }
.cat .cat-svc thead tr, .cat .cat-prd thead tr, .cat .cat-pkg thead tr { border-bottom: 1px solid var(--border); }
.cat .cat-svc th, .cat .cat-prd th, .cat .cat-pkg th { text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 600; color: var(--text-muted); height: 40px; padding: 0 16px; box-sizing: border-box; }
.cat .cat-pkg th { text-align: left; }
.cat .cat-svc tr[data-id], .cat .cat-prd tr[data-id], .cat .cat-pkg tr[data-id] { height: 56px; border-bottom: 1px solid var(--border); }
.cat .cat-svc tr[data-id]:last-child, .cat .cat-prd tr[data-id]:last-child, .cat .cat-pkg tr[data-id]:last-child { border-bottom: 0; }
.cat .cat-svc td, .cat .cat-prd td, .cat .cat-pkg td { height: 56px; padding: 0 16px; box-sizing: border-box; white-space: nowrap; }
.cat .cat-svc .badge, .cat .cat-prd .badge, .cat .cat-pkg .badge { text-transform: none; letter-spacing: normal; font-size: 13px; }
.cat .cat-svc [data-skeleton], .cat .cat-prd [data-skeleton], .cat .cat-pkg [data-skeleton] { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.cat .cat-svc .cat-sk-row, .cat .cat-prd .cat-sk-row, .cat .cat-pkg .cat-sk-row { height: 56px; box-sizing: border-box; border-bottom: 1px solid var(--border); background: var(--surface-2); opacity: 0.5; }
.cat .cat-svc .cat-sk-row:last-child, .cat .cat-prd .cat-sk-row:last-child, .cat .cat-pkg .cat-sk-row:last-child { border-bottom: 0; }
.cat .cat-svc [role="alert"], .cat .cat-prd [role="alert"], .cat .cat-pkg [role="alert"] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 48px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 15px; color: var(--text-muted); text-align: center; }
.cat .cat-svc [data-retry], .cat .cat-prd [data-retry], .cat .cat-pkg [data-retry] { box-sizing: border-box; height: 38px; min-height: 38px; padding: 0 20px; font-size: 14px; font-weight: 600; border-radius: var(--r-pill, 9999px); border: 1px solid var(--border-input); background: transparent; color: var(--text); cursor: pointer; }
.cat .cat-svc .cat-empty, .cat .cat-prd .cat-empty, .cat .cat-pkg .cat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 48px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 15px; color: var(--text-muted); text-align: center; }
.cat .cat-svc [data-empty-new], .cat .cat-prd [data-empty-new], .cat .cat-pkg [data-empty-new] { box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 20px; font-size: 14px; font-weight: 600; border-radius: var(--r-pill, 9999px); border: 0; background: var(--btn-bg); color: var(--btn-fg); cursor: pointer; }
/* C2: busca da lista de Produtos */
.cat .cat-prd .cat-search { margin-bottom: 12px; }
.cat .cat-prd .cat-search input { box-sizing: border-box; width: 100%; max-width: 360px; height: 40px; padding: 0 14px; font-size: 14px; }
.cat .cat-pkg .is-num { text-align: right; }
.cat .cat-pkg tr[data-pk-open] { cursor: pointer; }
@media (max-width: 767px) {
  .cat .cat-prd .cat-search input { height: 44px; max-width: none; }
  .cat .cat-pkg .cat-col-svc, .cat .cat-pkg .cat-col-cred, .cat .cat-pkg .cat-col-val, .cat .cat-pkg .cat-col-days { display: none; }
  .cat .cat-pkg .cat-col-name { order: 1; flex: 1 1 calc(100% - 80px); font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
  .cat .cat-pkg .cat-col-status { order: 2; flex: 0 0 auto; text-align: right; }
  .cat .cat-pkg .cat-col-price { order: 3; flex: 0 0 auto; margin-top: 6px; }
  .cat .cat-pkg .cat-col-unit { order: 4; flex: 0 0 auto; margin-top: 6px; }
  .cat .cat-prd .cat-col-cost, .cat .cat-prd .cat-col-margin, .cat .cat-prd .cat-col-pct, .cat .cat-prd .cat-col-stock { display: none; }
  .cat .cat-tab { height: 44px; padding: 0 14px; }
  .cat .cat-head h1 { font-size: 24px; line-height: 32px; }
  .cat .cat-head #new, .cat .cat-head #newpkg { height: 44px; min-height: 44px; }
  .cat .cat-svc [data-retry], .cat .cat-prd [data-retry], .cat .cat-pkg [data-retry] { height: 44px; min-height: 44px; }
  .cat .cat-svc [data-empty-new], .cat .cat-prd [data-empty-new], .cat .cat-pkg [data-empty-new] { height: 44px; min-height: 44px; }
  .cat .cat-svc .cat-table-wrap, .cat .cat-prd .cat-table-wrap, .cat .cat-pkg .cat-table-wrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .cat .cat-svc thead, .cat .cat-prd thead, .cat .cat-pkg thead { display: none; }
  .cat .cat-svc table, .cat .cat-prd table, .cat .cat-pkg table, .cat .cat-svc tbody, .cat .cat-prd tbody, .cat .cat-pkg tbody { display: block; width: 100%; min-width: 0; }
  .cat .cat-svc tr[data-id], .cat .cat-prd tr[data-id], .cat .cat-pkg tr[data-id] { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 56px; height: auto; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-sizing: border-box; width: 100%; }
  .cat .cat-svc td, .cat .cat-prd td, .cat .cat-pkg td { height: auto; padding: 0; white-space: normal; background: transparent; }
  .cat .cat-svc .cat-col-name, .cat .cat-prd .cat-col-name { order: 1; flex: 1 1 calc(100% - 80px); font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
  .cat .cat-svc .cat-col-status, .cat .cat-prd .cat-col-status { order: 2; flex: 0 0 auto; text-align: right; }
  .cat .cat-svc .cat-col-price, .cat .cat-prd .cat-col-price { order: 3; flex: 0 0 auto; font-size: 14px; color: var(--text-muted); margin-top: 6px; }
  .cat .cat-svc .cat-col-dur, .cat .cat-prd .cat-col-dur { order: 4; flex: 0 0 auto; font-size: 14px; color: var(--text-3); margin-top: 6px; }
  .cat .cat-svc .cat-col-pct, .cat .cat-prd .cat-col-pct, .cat .cat-svc .cat-col-gencom, .cat .cat-prd .cat-col-gencom { display: none; }
}

/* CT1: Serviços — busca, foco da linha e ficha em gaveta */
.cat .cat-svc .cat-search { margin-bottom: 12px; }
.cat .cat-svc .cat-search input { box-sizing: border-box; width: 100%; max-width: 360px; height: 40px; padding: 0 14px; font-size: 14px; border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface); color: var(--text); }
.cat .cat-svc tr[data-id]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat .cat-svc tr[data-id]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat-ficha { box-sizing: border-box; width: 100%; }
.cat-ficha .cat-ficha-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cat-ficha h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); }
.cat-ficha [data-drawer-close] { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--r-md); }
.cat-ficha [data-drawer-close]:hover { color: var(--text); }
.cat-ficha input:not([type=radio]):not([type=checkbox]) { box-sizing: border-box; min-height: 44px; border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface); color: var(--text); }
.cat-ficha button { box-sizing: border-box; min-height: 44px; }
.cat-ficha label { white-space: nowrap; }
.cat-ficha label:has(input[type=radio]) { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }
.cat-ficha label:has(input[type=checkbox]) { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }
@media (max-width: 767px) {
  .cat .cat-svc .cat-search input { height: 44px; max-width: none; }
}

/* CT2: Produtos — busca, foco da linha e ficha em gaveta */
.cat .cat-prd .cat-search input { border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface); color: var(--text); }
.cat .cat-prd tr[data-id]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat .cat-prd tr[data-id]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* CT3: Pacotes — busca, foco da linha e gavetas */
.cat .cat-pkg .cat-search { margin-bottom: 12px; }
.cat .cat-pkg .cat-search input { box-sizing: border-box; width: 100%; max-width: 360px; height: 40px; padding: 0 14px; font-size: 14px; border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface); color: var(--text); }
.cat .cat-pkg tr[data-id]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat .cat-pkg tr[data-id]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-pk-form] .pk-stack button, [data-pk-rules-sheet] .pk-stack button, [data-pk-adjust] .pk-stack button { white-space: nowrap; }
[data-pk-adjust] #cp-reactivate { white-space: normal; }
@media (max-width: 767px) {
  .cat .cat-pkg .cat-search input { height: 44px; max-width: none; }
  .cat .pk-subtabs [data-s] { min-height: 44px; }
  .cat .pk-row #sell { min-height: 44px; }
  .cat [data-pkg-rules-edit], .cat [data-pkg-rules-edit].pk-btn { min-height: 44px; }
  .cat [data-pkg-rules-retry], .cat [data-pkg-rules-retry].pk-btn { min-height: 44px; }
}
