/* Responsivo: celular, tablet, notebook e desktop */

:root {
  --brand-50: #fef2f2;
  --brand-100: #fee2e2;
  --brand-600: #dc2626;
  --brand-700: #b91c1c;
  --brand-800: #991b1b;
  --brand-900: #7f1d1d;
  --cor-principal: var(--brand-800);
  --cor-topo: #000000;
  --shell-pad: clamp(0.75rem, 2.5vw, 1.5rem);
  --shell-max: 100%;
}

.store-catalog-header {
  background-color: var(--cor-topo, #000000);
}

/* Painel do lojista */
.painel-page {
  min-height: 100dvh;
  padding-bottom: 0;
}

.painel-shell {
  display: flex;
  width: 100%;
  min-height: 100dvh;
}

.painel-sidebar {
  width: 11.5rem;
  flex-shrink: 0;
  background-color: #0c0a09;
  color: #fafaf9;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 0.5rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 30;
}

.painel-sidebar-brand {
  padding: 0.5rem 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.painel-sidebar-brand__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a8a29e;
}

.painel-sidebar-brand__sub {
  font-size: 0.625rem;
  color: #78716c;
  margin-top: 0.15rem;
}

.painel-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin-left: 11.5rem;
  width: calc(100% - 11.5rem);
}

.painel-page .page-main {
  flex: 1;
  padding-bottom: 1rem;
}

.painel-header {
  background-color: var(--cor-topo, #0c0a09) !important;
  color: #fff;
}

.painel-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 0.25rem;
  flex: 1;
  min-height: 0;
}

.painel-sidebar-footer {
  margin-top: auto;
  padding: 0.5rem 0.35rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.painel-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a8a29e;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s, color 0.15s;
}

.painel-sidebar-toggle:hover,
.painel-sidebar-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fafaf9;
}

.painel-sidebar-toggle__icon {
  font-size: 0.625rem;
  line-height: 1;
}

.painel-sidebar-expand {
  position: fixed;
  left: 0.65rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: #0c0a09;
  color: #fafaf9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.painel-shell--sidebar-collapsed .painel-sidebar {
  width: 0 !important;
  padding: 0;
  overflow: hidden;
  border: none;
  pointer-events: none;
}

.painel-shell--sidebar-collapsed .painel-content {
  margin-left: 0 !important;
  width: 100% !important;
}

.btn-copy-feedback.is-copy-success {
  background-color: #15803d !important;
}

.btn-copy-feedback.is-copy-error {
  background-color: #b91c1c !important;
}

.painel-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  border-radius: 0.5rem;
  color: #d6d3d1;
  transition: background-color 0.15s, color 0.15s;
}

.painel-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.painel-nav-item.is-active {
  background: var(--brand-800, #991b1b);
  color: #fff;
}

.painel-nav-item--loja {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #a8a29e;
}

.painel-nav-item--loja:hover {
  color: #fff;
}

.painel-fab {
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 25;
}

.painel-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.painel-stats--solo {
  grid-template-columns: 1fr;
}

.painel-stat-card {
  text-align: left;
}

/* Financeiro — seletor de período */
.finance-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.finance-period-tab {
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #57534e;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.finance-period-tab.is-active {
  background: var(--brand-800, #991b1b);
  border-color: var(--brand-800, #991b1b);
  color: #fff;
}

/* Gráficos do financeiro */
.painel-charts-grid {
  display: grid;
  gap: 1rem;
}

.painel-chart-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.painel-chart-bar-row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.painel-chart-bar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #78716c;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.painel-chart-bar-track {
  height: 0.5rem;
  background: #f5f5f4;
  border-radius: 999px;
  overflow: hidden;
}

.painel-chart-bar-fill {
  height: 100%;
  min-width: 0.25rem;
  background: linear-gradient(90deg, #991b1b, #dc2626);
  border-radius: 999px;
}

.painel-chart-bar-value {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #44403c;
  white-space: nowrap;
}

.painel-chart-empty {
  font-size: 0.8125rem;
  color: #78716c;
  text-align: center;
  padding: 1.25rem 0.5rem;
}

@media (min-width: 768px) {
  .painel-charts-grid {
    grid-template-columns: 1fr 1fr;
  }

  .painel-chart-bar-row {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
  }

  #top-products-chart .painel-chart-bar-row {
    grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr) auto;
  }

  #top-products-chart .painel-chart-bar-label {
    max-width: none;
  }

  /* Botões largos do painel — compactos no desktop */
  .painel-page .page-main button.w-full,
  .painel-page .page-main .painel-form-submit {
    width: auto;
    min-width: 9rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .painel-page .page-main button.touch-target:not(.painel-order-btn):not(.agenda-filter-btn) {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .painel-page .page-main form .form-input {
    max-width: 28rem;
  }
}

/* Pedidos — mobile empilhado; desktop em linhas compactas */
.painel-orders-panel {
  background: #fff;
}

.painel-orders-filters {
  row-gap: 0.5rem;
}

.painel-orders-date-picker input[type='date'] {
  max-width: 9rem;
}

.painel-orders-day-divider {
  list-style: none;
  padding: 0.65rem 0 0.35rem;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #78716c;
  background: #fafaf9;
  border-bottom: 1px solid #e7e5e4;
}

.painel-orders-day-divider:first-child {
  padding-top: 0.35rem;
}

.painel-order-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.375rem;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
}

.painel-order-num--inline {
  margin-right: 0.35rem;
  vertical-align: middle;
}

.painel-order-cell--num {
  display: none;
}

.painel-orders-head {
  display: none;
}

.painel-order-grid {
  display: grid;
  gap: 0.35rem 0.75rem;
}

.painel-order-meta-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a8a29e;
  margin-bottom: 0.1rem;
}

.painel-order-cell--amount {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.painel-order-cell--actions:empty {
  display: none;
}

.painel-order-cell--actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.painel-order-print {
  width: 100%;
}

.painel-order-print-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.painel-order-print + .painel-order-actions,
.painel-order-print-actions + .painel-order-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e7e5e4;
}

.painel-order-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.painel-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.painel-order-btn--confirm {
  background: #16a34a;
  color: #fff;
}

.painel-order-btn--realizado {
  background: #2563eb;
  color: #fff;
}

.painel-order-btn--cancel {
  border: 1px solid #fecaca;
  color: #b91c1c;
  background: #fff;
}

.painel-order-btn--print {
  border: 1px solid #d6d3d1;
  color: #44403c;
  background: #fafaf9;
}

.painel-order-row {
  border-bottom: 1px solid #f5f5f4;
  padding: 0.85rem 0;
}

.painel-order-row:last-child {
  border-bottom: 0;
}

.painel-order-address,
.painel-order-pay {
  font-size: 0.75rem;
  line-height: 1.35;
  color: #57534e;
  word-break: break-word;
}

@media (min-width: 768px) {
  .painel-orders-panel {
    border-radius: 0.75rem;
    box-shadow: none;
  }

  .painel-orders-head {
    display: grid;
    grid-template-columns: minmax(2.25rem, 0.35fr) minmax(8.5rem, 1.05fr) minmax(11rem, 2fr) minmax(7rem, 0.95fr) minmax(5.5rem, 0.65fr) minmax(10rem, auto);
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #e7e5e4;
    background: #fafaf9;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #78716c;
  }

  .painel-orders-head span:last-child {
    text-align: right;
  }

  .painel-order-grid {
    grid-template-columns: minmax(2.25rem, 0.35fr) minmax(8.5rem, 1.05fr) minmax(11rem, 2fr) minmax(7rem, 0.95fr) minmax(5.5rem, 0.65fr) minmax(10rem, auto);
    gap: 0.75rem 1rem;
    align-items: center;
  }

  .painel-order-cell--num {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .painel-order-num--inline {
    display: none !important;
  }

  .painel-order-meta-label {
    display: none;
  }

  .painel-order-cell--amount {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.25rem;
  }

  .painel-order-cell--actions {
    justify-self: end;
  }

  .painel-order-print + .painel-order-actions {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .painel-order-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: auto;
    gap: 0.35rem;
  }

  .painel-order-btn {
    width: auto;
    min-height: 1.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    white-space: nowrap;
  }

  .painel-order-row {
    padding: 0.65rem 0;
  }

  .painel-order-row:hover {
    background: #fafaf9;
  }
}

body.painel-confirm-open {
  overflow: hidden;
}

.painel-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(28, 25, 23, 0.45);
}

.painel-confirm-balloon {
  width: min(100%, 22rem);
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid #e7e5e4;
}

.painel-confirm-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1c1917;
  margin: 0 0 0.5rem;
}

.painel-confirm-message {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #57534e;
  margin: 0 0 1rem;
}

.painel-confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.painel-confirm-btn {
  min-height: 2.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.painel-confirm-btn--cancel {
  border: 1px solid #d6d3d1;
  background: #fff;
  color: #44403c;
}

.painel-confirm-btn--ok {
  border: none;
  background: #991b1b;
  color: #fff;
}

.painel-confirm-btn--ok.is-danger {
  background: #b91c1c;
}

.painel-categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.painel-category-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  background: #fafaf9;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.painel-category-row--editing {
  background: #fff;
  border-color: #d6d3d1;
}

.painel-category-row--dragging {
  opacity: 0.45;
}

.painel-category-row--drop-target {
  border-color: var(--brand-800, #991b1b);
  box-shadow: 0 0 0 2px rgba(153, 27, 27, 0.15);
}

.painel-category-drag {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: #a8a29e;
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
  border-radius: 0.375rem;
}

.painel-category-drag:active {
  cursor: grabbing;
}

.painel-category-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.painel-category-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1c1917;
}

.painel-category-meta {
  font-size: 0.6875rem;
  color: #78716c;
}

.painel-category-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.painel-category-btn {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 0.375rem;
  border: 1px solid #d6d3d1;
  background: #fff;
  color: #44403c;
  white-space: nowrap;
}

.painel-category-btn--save {
  background: var(--brand-800, #991b1b);
  border-color: var(--brand-800, #991b1b);
  color: #fff;
}

.painel-category-btn--danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff;
}

.stock-row--inactive {
  opacity: 0.62;
}

.stock-row--inactive img {
  filter: grayscale(0.35);
}

.stock-toggle-btn {
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.stock-toggle-btn--active {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fbbf24;
}

.stock-toggle-btn--active:hover {
  background: #fde68a;
}

.stock-toggle-btn--inactive {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #4ade80;
}

.stock-toggle-btn--inactive:hover {
  background: #bbf7d0;
}

.stock-toggle-btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.ajuda-faq-item summary::-webkit-details-marker {
  display: none;
}

.ajuda-faq-item[open] {
  border-color: #e7e5e4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.painel-stock-categories {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.painel-stock-categories .stock-category-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #44403c;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.painel-stock-categories .stock-category-btn.is-active {
  background: var(--brand-800, #991b1b);
  border-color: var(--brand-800, #991b1b);
  color: #fff;
}

@media (min-width: 768px) {
  .painel-sidebar {
    width: 14rem;
  }

  .painel-content {
    margin-left: 14rem;
    width: calc(100% - 14rem);
  }

  .painel-nav-item {
    font-size: 0.875rem;
    min-height: 2.875rem;
  }
}

@media (max-width: 767px) {
  .painel-sidebar {
    width: 10rem;
  }

  .painel-content {
    margin-left: 10rem;
    width: calc(100% - 10rem);
  }

  .painel-nav-item {
    font-size: 0.75rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.55rem;
  }

  .painel-sidebar-brand__sub {
    display: none;
  }
}


.text-brand-600 {
  color: var(--brand-600) !important;
}
.text-brand-700 {
  color: var(--brand-700) !important;
}
.text-brand-800 {
  color: var(--brand-800) !important;
}
.bg-brand-600 {
  background-color: var(--brand-600) !important;
}
.bg-brand-700 {
  background-color: var(--brand-700) !important;
}
.bg-brand-800 {
  background-color: var(--brand-800) !important;
}
.bg-brand-900 {
  background-color: var(--brand-900) !important;
}
.active\:bg-brand-900:active,
.active\:bg-brand-800:active {
  background-color: var(--brand-900) !important;
}
.hover\:bg-brand-900:hover {
  background-color: var(--brand-900) !important;
}
.border-brand-800 {
  border-color: var(--brand-800) !important;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

html {
  height: 100%;
}

html,
body {
  overflow-x: hidden;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Conteúdo principal ocupa a altura útil da tela */
body.page-flex {
  display: flex;
  flex-direction: column;
}

body.page-flex .page-main,
body.page-flex .catalog-main {
  flex: 1 1 auto;
  width: 100%;
}

body.page-flex #catalog-app {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.hidden {
  display: none !important;
}

/* Container central — cresce conforme o dispositivo */
.mobile-shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--shell-pad);
  padding-right: var(--shell-pad);
  box-sizing: border-box;
}

/* px-* no HTML soma com shell-pad; neutraliza padding horizontal duplicado */
.mobile-shell.px-3,
.mobile-shell.px-4 {
  padding-left: max(var(--shell-pad), 0.75rem);
  padding-right: max(var(--shell-pad), 0.75rem);
}

@media (min-width: 480px) {
  :root {
    --shell-max: 32rem;
  }
}

@media (min-width: 768px) {
  :root {
    --shell-max: 42rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --shell-max: 56rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --shell-max: 72rem;
  }
}

@media (min-width: 1536px) {
  :root {
    --shell-max: 80rem;
  }
}

/* Checkout / confirmação: coluna legível em telas grandes */
body.shell-compact {
  --shell-max: 100%;
}

@media (min-width: 640px) {
  body.shell-compact {
    --shell-max: 30rem;
  }
}

@media (min-width: 1024px) {
  body.shell-compact {
    --shell-max: 36rem;
  }
}

/* Superadmin: formulários largos */
body.shell-admin {
  --shell-max: 100%;
}

@media (min-width: 768px) {
  body.shell-admin {
    --shell-max: 48rem;
  }
}

@media (min-width: 1024px) {
  body.shell-admin {
    --shell-max: 64rem;
  }
}

@media (min-width: 1280px) {
  body.shell-admin {
    --shell-max: 80rem;
  }
}

/* Grid de produtos do catálogo */
.catalog-product-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-product-grid > .catalog-grid-message {
  grid-column: 1 / -1;
}

.catalog-section-heading {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0.15rem;
  padding: 0.35rem 0.15rem 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #78716c;
  border-bottom: 1px solid #e7e5e4;
}

.catalog-section-heading:first-child {
  margin-top: 0;
}

.catalog-section-heading.hidden {
  display: none;
}

@media (min-width: 640px) {
  .catalog-product-grid {
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .catalog-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .catalog-product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Cabeçalho e rodapé em largura total; conteúdo centralizado */
.site-header-wrap,
.cart-bar,
.add-modal {
  width: 100%;
}

.store-catalog-header .mobile-shell,
.cart-bar .mobile-shell {
  max-width: var(--shell-max);
}

@media (min-width: 768px) {
  .header-logo {
    max-width: 28rem;
    max-height: 7.5rem;
  }

  .catalog-header-brand.has-header-image {
    height: 8rem;
    min-height: 8rem;
    max-height: 8rem;
  }
}

.site-header-wrap {
  padding-top: env(safe-area-inset-top, 0);
}

/* Selo Aberto/Fechado — canto superior direito do topo colorido */
.catalog-status-badge {
  top: max(0.5rem, env(safe-area-inset-top, 0px));
  right: 0.75rem;
}

.catalog-hours-wrap {
  position: absolute;
  top: max(0.45rem, env(safe-area-inset-top, 0px));
  left: 0.65rem;
  z-index: 12;
  max-width: calc(100% - 7.5rem);
}

.catalog-hours-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.3rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(4px);
}

.catalog-hours-btn:active {
  background: rgba(0, 0, 0, 0.32);
}

.catalog-hours-btn-icon {
  font-size: 11px;
  line-height: 1;
}

.catalog-hours-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9.5rem;
}

.catalog-hours-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 13.5rem;
  max-width: min(18rem, 92vw);
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #1c1917;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.catalog-hours-popover-title {
  margin: 0 0 0.45rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #78716c;
}

.catalog-hours-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-hours-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0;
  font-size: 12px;
  color: #44403c;
}

.catalog-hours-row--today {
  font-weight: 700;
  color: #1c1917;
}

.catalog-hours-row--closed span:last-child {
  color: #a8a29e;
}

/* Campos bloqueados após autopreenchimento da sessão do cliente */
.checkout-field-locked {
  background: #fafaf9;
  color: #44403c;
}

.header-logo {
  width: 92vw;
  max-width: 22rem;
  max-height: 5.75rem;
}

.header-store-name {
  width: 100%;
  max-width: 22rem;
  line-height: 1.2;
}

/* Logo da loja grande dentro da faixa do topo */
.catalog-header-brand.has-header-image {
  height: 6rem;
  min-height: 6rem;
  max-height: 6rem;
  width: 100%;
  padding: 0.2rem 0;
}

.catalog-header-brand.has-header-image .header-logo-custom {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 414px) {
  .header-logo {
    max-height: 6.5rem;
  }

  .catalog-header-brand.has-header-image {
    height: 7rem;
    min-height: 7rem;
    max-height: 7rem;
  }
}

.catalog-main {
  padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
}

.catalog-search-wrap {
  position: sticky;
  top: 0;
  z-index: 15;
  background: linear-gradient(180deg, #fafaf9 85%, rgba(250, 250, 249, 0));
  padding-bottom: 0.35rem;
}

.catalog-search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.catalog-search-field:focus-within {
  border-color: var(--brand-800, #991b1b);
  box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.12);
}

.catalog-search-icon {
  display: flex;
  color: #a8a29e;
  flex-shrink: 0;
}

.catalog-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: #1c1917;
  outline: none;
}

.catalog-search-input::placeholder {
  color: #a8a29e;
}

.catalog-search-input::-webkit-search-cancel-button {
  display: none;
}

.catalog-search-clear {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  border: 0;
  background: #f5f5f4;
  color: #78716c;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.catalog-search-clear:active {
  background: #e7e5e4;
}

.category-pill {
  scroll-snap-align: start;
}

.categories-scroll {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 0.75rem;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

/* Área mínima de toque (~44px) para dedo no celular */
.touch-target {
  min-height: 2.75rem;
  touch-action: manipulation;
}

.product-card img {
  transition: transform 0.2s ease;
}

.product-card:active img {
  transform: scale(0.98);
}

.cart-bar {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

#cart-btn {
  min-height: 3.25rem;
}

.page-main {
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
}

body:not(.page-flex) .page-main {
  min-height: 50vh;
}

.page-with-footer .page-main {
  padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #44403c;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  font-size: 16px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  background: #fff;
}

.form-input:focus {
  outline: 2px solid var(--brand-800);
  outline-offset: 0;
  border-color: var(--brand-800);
}

.option-card {
  cursor: pointer;
}

/* Bolinha de rádio customizada (forma de pagamento) */
.option-card .radio-indicator {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  border-radius: 50%;
  border: 2px solid #a8a29e;
  margin-top: 0.15rem;
  position: relative;
  background: #fff;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.option-card input:checked ~ span .radio-indicator {
  border-color: var(--brand-800, #1c1917);
}

.option-card input:checked ~ span .radio-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border-radius: 50%;
  background: var(--brand-800, #1c1917);
}

.add-modal {
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) var(--shell-pad)
    max(0.75rem, env(safe-area-inset-bottom, 0px));
  align-items: flex-end;
}

@media (min-width: 768px) {
  .add-modal {
    align-items: center;
    padding: 1.5rem;
  }

  .add-modal > .mobile-shell {
    max-width: 28rem;
    border-radius: 1rem;
    max-height: min(85vh, 40rem);
  }
}

.add-modal.hidden {
  display: none;
}

.empty-state {
  padding-left: 1rem;
  padding-right: 1rem;
}

.image-upload-box:active #upload-placeholder {
  border-color: var(--brand-800);
  background: var(--brand-50);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2378716c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* —— Login do lojista (isolado do tema das lojas) —— */
.login-page {
  --login-accent: #991b1b;
  --login-accent-hover: #7f1d1d;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0 !important;
  background: linear-gradient(180deg, #fafaf9 0%, #f5f5f4 100%);
  color: #1c1917;
}

.login-page__main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  background: #fff;
  border-radius: 1.25rem;
  border: 1px solid #e7e5e4;
  box-shadow:
    0 1px 2px rgba(28, 25, 23, 0.04),
    0 12px 40px rgba(28, 25, 23, 0.08);
  padding: 1.75rem 1.5rem 1.5rem;
  box-sizing: border-box;
}

.login-page__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-page__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1rem;
  border-radius: 9999px;
  background: #fef2f2;
  color: var(--login-accent);
}

.login-page__icon svg {
  width: 1.625rem;
  height: 1.625rem;
  display: block;
}

.login-page__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.375rem;
  color: #1c1917;
}

.login-page__subtitle {
  font-size: 0.875rem;
  color: #78716c;
  margin: 0;
  line-height: 1.4;
  max-width: 16rem;
}

.login-page__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.login-page__field {
  margin: 0;
  width: 100%;
}

.login-page .form-label {
  display: block;
  margin-bottom: 0.375rem;
}

.login-page .form-input,
.login-page__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  background: #fff;
}

.login-page .form-input:focus,
.login-page__input:focus {
  outline: 2px solid var(--login-accent);
  outline-offset: 0;
  border-color: var(--login-accent);
}

.login-page__submit {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--login-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.login-page__submit:hover:not(:disabled) {
  background: var(--login-accent-hover);
}

.login-page__submit:active:not(:disabled) {
  transform: scale(0.98);
}

.login-page__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-page__error {
  display: block;
  margin: 0;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.625rem;
}

.login-page__error:not(.hidden) {
  display: block !important;
}

.login-creds-hint {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  font-size: 0.75rem;
  color: #44403c;
}

.login-creds-hint__title {
  font-weight: 700;
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #78716c;
}

.login-creds-hint__btn {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid #d6d3d1;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1c1917;
  cursor: pointer;
}

.login-creds-hint__btn:active {
  background: #fef2f2;
  border-color: #991b1b;
}

.login-creds-hint__note {
  margin: 0.5rem 0 0;
  line-height: 1.4;
  color: #78716c;
}

@media (min-width: 480px) {
  .login-card {
    padding: 2rem 1.75rem 1.75rem;
  }

  .login-page__title {
    font-size: 1.5rem;
  }
}

/* Catálogo: loader / skeleton antes dos dados da loja */
.catalog-loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  align-items: flex-start;
  justify-content: center;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: #fafaf9;
  overflow-y: auto;
}

.catalog-loader-inner {
  width: 100%;
  max-width: var(--shell-max, 100%);
  margin: 0 auto;
  padding-left: var(--shell-pad);
  padding-right: var(--shell-pad);
  box-sizing: border-box;
}

/* Painel: sidebar em telas grandes */
@media (min-width: 768px) {
  .painel-page .page-main {
    padding-bottom: 1.25rem;
  }
}

/* Admin: lista de lojas em grade no tablet+ */
@media (min-width: 768px) {
  #lojas-list.admin-lojas-grid,
  #lojas-list:has(article) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (min-width: 1280px) {
  #lojas-list:has(article) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.shell-admin #loja-form-view .rounded-2xl.border {
    max-width: none;
  }
}

/* Formulários: evita zoom indesejado no iOS e largura total */
@media (min-width: 768px) {
  .form-input,
  .form-input textarea,
  select.form-input {
    font-size: 1rem;
  }
}

/* Imagens e mídia responsivas */
img,
video {
  max-width: 100%;
  height: auto;
}

/* Tabelas / listas longas */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

.catalog-loader-label {
  letter-spacing: 0.01em;
}

body.catalog-ready #catalog-loader {
  pointer-events: none;
}

/* Anti-flash: painel só aparece após auth + initPainel */
html.painel-auth-pending body.painel-page {
  visibility: hidden;
}

html.painel-auth-ok.painel-ready body.painel-page {
  visibility: visible;
}

/* Anti-flash: loja (pedido, sacola, confirmação) até markPageReady */
html.page-init-pending body:not(.catalog-page-loading) {
  visibility: hidden;
}

html.page-init-ready body {
  visibility: visible;
}

/* Confirmação: bloco certo desde o primeiro frame (sem “Pedido enviado” no PIX) */
html.confirm-mode-normal #confirm-pix,
html.confirm-mode-normal #confirm-pix-done {
  display: none !important;
}

html.confirm-mode-pix #confirm-normal {
  display: none !important;
}

html.confirm-mode-pix #confirm-pix {
  display: block !important;
}

html.confirm-mode-pix #confirm-pix.hidden {
  display: block !important;
}

html.confirm-mode-pix #confirm-pix-done {
  display: none !important;
}

html.confirm-mode-done #confirm-normal,
html.confirm-mode-done #confirm-pix {
  display: none !important;
}

html.confirm-mode-done #confirm-pix-done {
  display: block !important;
}

html.confirm-mode-done #confirm-pix-done.hidden {
  display: block !important;
}

/* Painel — Recebimentos (estados PIX) */
.recebimentos-hero {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.recebimentos-hero--red {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
}

.recebimentos-hero--yellow {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
}

.recebimentos-hero--green {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}

.recebimentos-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
}

.recebimentos-status-badge__icon {
  font-size: 1.125rem;
  line-height: 1;
}

.recebimentos-status-badge--red {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.recebimentos-status-badge--yellow {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.recebimentos-status-badge--green {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.recebimentos-step {
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: #f5f5f4;
}

.recebimentos-step--done {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.recebimentos-trust strong {
  font-weight: 600;
}

.recebimentos-modal {
  max-width: 22rem;
}

/* Rastreio público */
.rastreio-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rastreio-step {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1rem;
  position: relative;
}

.rastreio-step:not(.is-last)::before {
  content: '';
  position: absolute;
  left: 0.4375rem;
  top: 1.125rem;
  bottom: 0;
  width: 2px;
  background: #e7e5e4;
}

.rastreio-step--done:not(.is-last)::before {
  background: #991b1b;
}

.rastreio-step-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 2px solid #d6d3d1;
  background: #fff;
  flex-shrink: 0;
  margin-top: 0.125rem;
  z-index: 1;
}

.rastreio-step--done .rastreio-step-dot,
.rastreio-step--active .rastreio-step-dot {
  border-color: #991b1b;
  background: #991b1b;
}

.rastreio-step--active .rastreio-step-dot {
  box-shadow: 0 0 0 4px rgba(153, 27, 27, 0.15);
}

.rastreio-step-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #44403c;
}

.rastreio-step--pending .rastreio-step-label {
  color: #a8a29e;
  font-weight: 500;
}

/* Detalhe do pedido no painel */
.painel-order-row.is-expanded {
  background: #fafaf9;
}

.painel-order-detail {
  grid-column: 1 / -1;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px dashed #e7e5e4;
  margin-top: 0.5rem;
}

.painel-order-detail-items {
  font-size: 0.75rem;
  color: #57534e;
  margin: 0.5rem 0;
}

.painel-order-rastreio {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.625rem;
  background: #fef2f2;
  border-radius: 0.75rem;
  font-size: 0.75rem;
}

.painel-order-rastreio-url {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  word-break: break-all;
  color: #57534e;
}
