/* PedidoOnline - correção lista de produtos + categorias loja */

.products-grid.po-products-list-mode {
  display: block !important;
  grid-template-columns: none !important;
  width: 100% !important;
}

.po-products-list-toolbar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.po-products-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.po-products-list-actions select {
  min-width: 240px;
}

.po-products-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
}

.po-products-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 13px;
}

.po-products-table th,
.po-products-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f1f1;
  vertical-align: middle;
}

.po-products-table th {
  background: #fafafa;
  text-align: left;
  font-size: 12px;
  color: var(--text-muted, #777);
  font-weight: 900;
}

.po-products-table tr:hover td {
  background: #fffaf8;
}

.po-col-check {
  width: 36px;
  text-align: center;
}

.po-col-image {
  width: 68px;
}

.po-col-product {
  min-width: 280px;
}

.po-product-title {
  font-weight: 900;
  color: var(--text, #111827);
}

.po-product-desc {
  font-size: 12px;
  color: var(--text-muted, #777);
  margin-top: 3px;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.po-list-thumb,
.po-list-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: #f6f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.po-money {
  font-weight: 900;
  white-space: nowrap;
}

.po-promo-price {
  color: #ff4b2b;
  font-weight: 900;
}

.po-status-active {
  color: #059669;
  font-weight: 900;
}

.po-status-inactive {
  color: #dc2626;
  font-weight: 900;
}

.po-col-actions {
  width: 150px;
  text-align: right;
  white-space: nowrap;
}

.po-col-actions .btn {
  margin-left: 4px;
}

/* Loja: categorias roláveis horizontalmente */
.ph-cats {
  display: flex !important;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 16px 10px !important;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.ph-cats::-webkit-scrollbar {
  height: 5px;
}

.ph-cats::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.18);
  border-radius: 999px;
}

.ph-cat {
  flex: 0 0 auto;
  min-width: 68px;
  scroll-snap-align: start;
}

.po-cats-hint {
  padding: 0 16px 6px;
  font-size: 11px;
  color: var(--text-muted, #777);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Produto personalizável: grupos de opções/adicionais */
.po-option-group{border:1px solid #ececec;border-radius:14px;padding:12px;margin-top:12px;background:#fff}
.po-option-group__head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}
.po-option-group__title{font-size:14px;font-weight:900;color:var(--text)}
.po-option-group__rule{font-size:11px;font-weight:800;color:var(--text-muted);text-align:right}
.po-option-item{display:flex;align-items:center;gap:10px;padding:9px 0;border-top:1px solid #f2f2f2;cursor:pointer}
.po-option-item:first-of-type{border-top:0}
.po-option-item input{width:18px;height:18px;accent-color:var(--primary);flex:0 0 18px}
.po-option-item__name{flex:1;font-size:13px;font-weight:800}
.po-option-item__price{font-size:12px;font-weight:900;color:var(--primary);white-space:nowrap}
.po-options-summary{font-size:12px;color:var(--text-muted);font-weight:800;margin-top:8px}
.po-item-options-line{font-size:12px;line-height:1.4;color:var(--text-muted);margin-top:4px}
.po-item-notes-line{font-size:12px;line-height:1.4;color:#7a4b00;background:#fff7ed;border-radius:8px;padding:5px 7px;margin-top:5px}

/* Admin: gerenciador de opções/adicionais */
.po-options-admin-modal{max-width:760px!important;width:min(760px,calc(100vw - 24px));max-height:90vh;overflow:auto}
.po-admin-option-group{border:1px solid #e8e8e8;border-radius:14px;padding:14px;margin:12px 0;background:#fff}
.po-admin-option-group__header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.po-admin-option-list{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.po-admin-option-row{display:flex;align-items:flex-end;gap:8px;padding:10px;border-radius:12px;background:var(--bg)}
.po-admin-option-remove{margin-bottom:1px}
@media(max-width:700px){.po-admin-option-row{align-items:stretch;flex-direction:column}.po-admin-option-row>div{width:100%!important}.po-admin-option-remove{width:100%;justify-content:center}.po-options-admin-modal{width:calc(100vw - 16px)}}


/* Casa Velha Truck — identidade pública/admin */
.po-store-top-actions{display:flex;gap:10px;padding:6px 16px 12px;flex-wrap:wrap;justify-content:center}
.po-store-top-btn{border:1px solid #e5e7eb;background:#fff;color:#171717;border-radius:13px;min-height:42px;padding:8px 13px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font:inherit;text-decoration:none;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.04)}
.po-store-top-btn span{font-size:12px;color:#666;font-weight:800}
.po-store-top-btn strong{font-size:13px;font-weight:900;color:#171717}
.po-store-top-btn.po-whatsapp-btn{border-color:#d6f5df;background:#f2fff6}
.po-store-top-btn.po-whatsapp-btn strong{color:#128c47}
.po-store-top-btn.po-install-btn{background:#17182b;border-color:#17182b;color:#fff}
.po-store-top-btn.po-install-btn span,.po-store-top-btn.po-install-btn strong{color:#fff}
.po-public-footer{margin:32px 16px 24px;padding:18px 12px 78px;border-top:1px solid #ececec;text-align:center;color:#777;font-size:11px;line-height:1.55}
.po-public-footer a{color:#17182b;font-weight:900;text-decoration:none}
.po-admin-brand-logo{width:42px;height:42px;object-fit:contain;display:block;flex:0 0 42px}
.sidebar-logo.po-branded{gap:10px}
.sidebar-logo.po-branded span{line-height:1.05}
.po-admin-install-btn{white-space:nowrap}
@media(max-width:700px){
  .po-store-top-actions{display:grid;grid-template-columns:1fr 1fr;padding-left:12px;padding-right:12px}
  .po-store-top-btn{padding:8px 7px;min-width:0}
  .po-store-top-btn strong{font-size:11px}
  .po-store-top-btn span{font-size:10px}
  .top-bar-actions .po-admin-install-btn{display:inline-flex!important}
}


/* =========================================================
   Casa Velha Truck — cabeçalho compacto + rodapé sempre visível
   v20260919-2
========================================================= */
body.public-page .po-public-header {
  flex-wrap: nowrap !important;
  gap: 12px !important;
}

body.public-page .po-public-header .ph-header-logo {
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  flex: 0 0 46px !important;
}

body.public-page .po-public-header .ph-header-logo img {
  width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
}

body.public-page .po-public-store-name {
  min-width: 112px;
  max-width: 150px;
  flex: 0 1 150px;
}

body.public-page .po-public-store-name .label {
  font-size: 12px !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.public-page .po-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

body.public-page .po-header-action {
  height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

body.public-page .po-header-action:hover {
  background: var(--primary-dark);
}

body.public-page .po-header-whatsapp svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 18px;
}

body.public-page .po-public-header .ph-cart-btn {
  margin-left: auto;
}

/* O crédito fica fora da área rolável, imediatamente acima da navegação. */
body.public-page .po-public-footer-bar {
  min-height: 34px;
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: #fff;
  color: #777;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  z-index: 9;
}

body.public-page .po-public-footer-bar a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

body.public-page .po-public-footer-bar a:hover {
  text-decoration: underline;
}

@media (min-width: 701px) {
  body.public-page .po-public-header {
    height: 66px !important;
    min-height: 66px !important;
    padding: 0 28px !important;
  }

  body.public-page .po-header-whatsapp {
    min-width: 180px;
  }

  body.public-page .po-header-install {
    min-width: 170px;
  }

  body.public-page .po-public-header .ph-cart-btn {
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 700px) {
  body.public-page .po-public-header {
    height: auto !important;
    min-height: 112px !important;
    padding: 8px 12px !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) 46px !important;
    grid-template-rows: 48px 38px !important;
    gap: 6px 10px !important;
  }

  body.public-page .po-public-header .ph-header-logo {
    grid-column: 1;
    grid-row: 1;
  }

  body.public-page .po-public-store-name {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    max-width: none;
    align-self: center;
  }

  body.public-page .po-public-header .ph-cart-btn {
    grid-column: 3;
    grid-row: 1;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    border-radius: 13px !important;
  }

  body.public-page .po-header-actions {
    grid-column: 1 / 4;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  body.public-page .po-header-action {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  body.public-page .po-header-whatsapp svg {
    width: 16px;
    height: 16px;
  }

  body.public-page .po-public-footer-bar {
    min-height: 44px;
    padding: 6px 8px;
    display: block;
    font-size: 9px;
    line-height: 1.35;
  }

  body.public-page .po-public-footer-bar .po-public-footer-separator {
    display: none;
  }

  body.public-page .po-public-footer-bar a {
    display: block;
    margin-top: 2px;
  }

  /* O rodapé já ocupa seu próprio espaço; evita sobra exagerada no scroll. */
  body.public-page .phone-body {
    padding-bottom: 18px !important;
  }
}


/* =========================================================
   Casa Velha Truck — desktop sem moldura "encaixotada"
   Mobile permanece com o layout aprovado.
   v20260919-3
========================================================= */
@media (min-width: 701px) {
  html,
  body.public-page {
    width: 100%;
    min-height: 100%;
    background: #fff !important;
  }

  body.public-page .store-shell {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    background: #fff !important;
  }

  body.public-page .store-shell .phone-frame {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    min-height: 100vh !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.public-page .po-public-header {
    padding-left: max(28px, calc((100vw - 1280px) / 2)) !important;
    padding-right: max(28px, calc((100vw - 1280px) / 2)) !important;
  }

  body.public-page .phone-body {
    padding-left: max(12px, calc((100vw - 1280px) / 2)) !important;
    padding-right: max(12px, calc((100vw - 1280px) / 2)) !important;
  }

  body.public-page .po-public-footer-bar {
    border-left: 0 !important;
    border-right: 0 !important;
  }

  body.public-page .phone-nav {
    padding-left: max(0px, calc((100vw - 920px) / 2)) !important;
    padding-right: max(0px, calc((100vw - 920px) / 2)) !important;
  }
}
