/* DistribuiPRO PDV Pro 1.0 */
/* Cartões de produto */
.pdx .product-card { position: relative; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.pdx .product-card:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, .28); }
.pdx .product-card .p-name { font-size: 13.5px; font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pdx .product-card .p-code { font-size: 11px; }
.pdx .product-card .p-price { font-size: 17px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pdx .product-card .p-stock { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px !important; font-weight: 700; margin-top: 0; }
.pdx .product-card .p-meta-row { align-items: center; gap: 8px; }
.pdx .product-card .p-meta-row .p-stock { flex: 0 0 auto !important; width: auto !important; max-width: 55%; white-space: nowrap; }
.pdx .p-stock.pdx-s-ok { color: #34d399 !important; background: rgba(16, 185, 129, .12); }
.pdx .p-stock.pdx-s-low { color: #fbbf24 !important; background: rgba(245, 158, 11, .13); }
.pdx .p-stock.pdx-s-out { color: #f87171 !important; background: rgba(239, 68, 68, .13); }
.pdx .product-card.pdx-out { opacity: .55 !important; filter: grayscale(.6); }
.pdx-qty { position: absolute; top: 8px; right: 8px; z-index: 2; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 0 3px var(--bg-card, #111); }
.pdx-qty.pop { animation: pdxPop .35s cubic-bezier(.3, 1.6, .5, 1); }
.pdx .product-card.pdx-added { animation: pdxAdded .45s ease; }
@keyframes pdxPop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes pdxAdded { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* Carrinho */
.pdx .cart-item { transition: background .3s; }
.pdx .cart-item.pdx-new { animation: pdxRow .9s ease; }
@keyframes pdxRow { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.pdx .cart-item .ci-name { font-size: 13px; font-weight: 650; }
.pdx .cart-item .ci-price, .pdx .cart-item .ci-price button { font-size: 11.5px !important; }
.pdx .cart-item .ci-qty button { width: 30px; height: 30px; border-radius: 9px; }
.pdx .cart-item .ci-total { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Itens primeiro no carrinho; cliente, vendedor, observações e pagamento logo abaixo */
.pdx #cartScroll { display: flex; flex-direction: column; }
.pdx #cartScroll > #cartItems { order: -1; min-height: 72px; border-bottom: 1px solid var(--border-color); }
.pdx #cartScroll > #cartItems .empty-state { padding: 18px 16px !important; }
.pdx #cartScroll > #cartItems .empty-state i { font-size: 24px !important; }
/* Tipo de venda: três botões na mesma linha também no celular */
.pdx #pdvCart div[style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.pdx .sale-type-btn { min-height: 44px; flex-direction: row !important; gap: 6px; justify-content: center; font-size: 12.5px; }

/* Rodapé com o total sempre visível */
.pdx-foot { flex-shrink: 0; border-top: 1px solid var(--border-color); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg-secondary)), var(--bg-secondary)); padding: 10px 16px 2px; }
.pdx-items { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pdx-more { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px 0; display: inline-flex; align-items: center; gap: 5px; }
.pdx-more i { transition: transform .2s; font-size: 10px; }
.pdx-foot.open .pdx-more i { transform: rotate(180deg); }
.pdx-foot .cart-summary { border-top: 0 !important; padding: 0 !important; }
.pdx-foot .cart-summary .cs-row:not(.total) { display: none; }
.pdx-foot.open .cart-summary .cs-row:not(.total) { display: flex; }
.pdx-foot .cart-summary .cs-row.total { border-top: 0 !important; margin-top: 2px !important; padding: 4px 0 6px !important; align-items: baseline; font-size: 15px !important; }
.pdx-foot #cartTotal { font-size: 26px; font-weight: 850; letter-spacing: -.03em; color: var(--text-heading, var(--text-primary)); font-variant-numeric: tabular-nums; }
#cartTotal.pdx-flash { animation: pdxFlash .5s ease; }
@keyframes pdxFlash { 0% { color: var(--accent); transform: scale(1.06); } 100% { transform: none; } }
.pdx #btnFinalize.pdx-ready { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.pdx .pdv-shortcuts { font-size: 11px; }

/* Vendas de hoje no topo */
.pdx-day { display: none; align-items: center; gap: 10px; flex: 0 0 auto; height: 42px; padding: 0 12px; margin-left: 10px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-card, transparent); color: var(--text-primary); cursor: pointer; text-align: left; }
.pdx-day > i:first-child { color: #34d399; }
.pdx-day span { display: grid; line-height: 1.1; }
.pdx-day small { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.pdx-day b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pdx-day em { font-style: normal; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.pdx-day .pdx-eye { font-size: 12px; color: var(--text-muted); }
@media (min-width: 1180px) { .pdx-day { display: inline-flex; } }

/* Botão do carrinho no celular com o total */
.pdx .pdv-mobile-toggle.pdx-has { width: auto !important; min-width: 56px; padding: 0 18px 0 16px !important; border-radius: 999px !important; gap: 10px; align-items: center; }
.pdx .pdv-mobile-toggle .pdx-ttl { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pdx .pdv-mobile-toggle:not(.pdx-has) .pdx-ttl { display: none; }
.pdx .pdv-mobile-toggle .toggle-badge { font-size: 11px !important; min-width: 20px; }
.pdx .pdv-mobile-toggle.bump { animation: pdxBump .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pdxBump { 0% { transform: scale(.88); } 100% { transform: scale(1); } }

/* Venda concluída */
.pdx-done { position: fixed; left: 50%; top: 22px; z-index: 6000; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 14px; border-radius: 16px; background: #0d1a14; border: 1px solid rgba(52, 211, 153, .35); color: #ecfdf5; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); animation: pdxIn .45s cubic-bezier(.2, 1.2, .3, 1); }
.pdx-done.out { opacity: 0; transform: translate(-50%, -12px); transition: opacity .4s, transform .4s; }
.pdx-done b { display: block; font-size: 14.5px; }
.pdx-done span { font-size: 13px; color: #a7f3d0; font-variant-numeric: tabular-nums; }
.pdx-check svg { width: 38px; height: 38px; }
.pdx-check circle { fill: rgba(16, 185, 129, .16); stroke: #34d399; stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152; animation: pdxDraw .5s ease forwards; }
.pdx-check path { fill: none; stroke: #34d399; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: pdxDraw .35s .35s ease forwards; }
@keyframes pdxDraw { to { stroke-dashoffset: 0; } }
@keyframes pdxIn { from { opacity: 0; transform: translate(-50%, -16px) scale(.95); } }

@media (max-width: 768px) {
  .pdx .product-card .p-name { font-size: 13px; }
  .pdx .product-card .p-price { font-size: 15.5px; }
  .pdx-foot #cartTotal { font-size: 24px; }
  .pdx-done { top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .pdx-qty.pop, .pdx .product-card.pdx-added, .pdx .cart-item.pdx-new, #cartTotal.pdx-flash, .pdx-done, .pdx .pdv-mobile-toggle.bump { animation: none !important; } }


/* 30.1 · Item do carrinho em duas linhas: nome inteiro em cima; quantidade e total embaixo */
.pdx .cart-item { position: relative; display: grid !important; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 12px 42px 12px 16px !important; }
.pdx .cart-item .ci-info { grid-column: 1 / -1; }
.pdx .cart-item .ci-name { white-space: normal !important; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px !important; line-height: 1.3; }
.pdx .cart-item .ci-price { margin-top: 3px; color: var(--text-muted); }
.pdx .cart-item .ci-qty { grid-column: 1; gap: 8px; }
.pdx .cart-item .ci-qty button { width: 30px !important; height: 30px !important; font-size: 11px; }
.pdx .cart-item .ci-qty span { font-size: 14px; min-width: 22px; }
.pdx .cart-item .ci-total { grid-column: 2; justify-self: end; font-size: 15px !important; min-width: 0 !important; }
.pdx .cart-item .ci-remove { position: absolute; top: 9px; right: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.pdx .cart-item .ci-remove:hover { background: rgba(239, 68, 68, .12); }
.pdx #cartItems { padding-top: 0; }

/* 30.1 · Cliente em destaque legível no tema escuro */
.pdx #selectedCustomerBadge { background: color-mix(in srgb, var(--accent) 16%, transparent) !important; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.pdx #selectedCustomerName { color: var(--text-primary) !important; font-weight: 700; }

/* 30.1 · Notebooks (tela baixa): nada de letra de 9px, tudo alinhado */
@media (min-width: 769px) and (max-height: 820px) {
  .pdx .pdv-party-row label, .pdx .cart-payment > label, .pdx #cartScroll label { font-size: 10.5px !important; }
  .pdx #customerSearch, .pdx #sellerSelect { height: 34px; font-size: 12.5px !important; }
  .pdx #selectedCustomerName { font-size: 12px !important; }
  .pdx .sale-type-btn { min-height: 38px; font-size: 12px !important; }
  .pdx .sale-type-btn i { font-size: 12px !important; }
  .pdx .cart-payment { padding: 8px 12px !important; }
  .pdx .payment-methods { gap: 6px !important; }
  .pdx .pay-method { min-height: 36px; font-size: 12px !important; gap: 6px !important; }
  .pdx .pay-method i { font-size: 12px !important; }
  .pdx .cart-items { max-height: 34vh !important; }
  .pdx .cart-item { padding: 10px 40px 10px 12px !important; }
  .pdx .cart-actions .btn { font-size: 12.5px !important; padding: 10px 6px !important; }
  .pdx .pdv-shortcuts { display: none !important; }
  .pdx .product-card .p-name { font-size: 12.5px !important; }
  .pdx .product-card .p-price { font-size: 15px !important; }
  .pdx .product-card .p-code { font-size: 10.5px !important; }
}

/* 30.1 · Carrinho cabe inteiro na tela no computador (o painel tem margem de 12px em cima e embaixo) */
@media (min-width: 769px) { .pdx .pdv-right { height: calc(100vh - 24px) !important; height: calc(100dvh - 24px) !important; } }
