/* ==========================================================================
   PDV & VITRINE DE PRODUTOS DE VENDA (DARK LUXO)
   Catálogo em Tela Cheia + Comanda Flutuante Deslizante (Slide-Over Drawer)
   ========================================================================== */

/* Layout da Vitrine em Tela Cheia (100% de Aproveitamento do Espaço) */
.pdv-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

.pdv-main-catalog {
  width: 100%;
  transition: all var(--transition-normal);
}

/* Categorias de Produtos (Pills) */
.pdv-category-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  margin-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.pdv-category-btn {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.pdv-category-btn:hover {
  border-color: var(--border-medium);
  background: var(--bg-subtle);
  color: var(--text-main);
}

.pdv-category-btn.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(197, 59, 60, 0.4);
}

/* Barra de Busca & Ações do PDV */
.pdv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pdv-search-box {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 240px;
}

.pdv-search-box input {
  padding-left: 2.35rem;
}

.pdv-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

/* Grid de Cards de Produtos Amplo e Confortável */
.pdv-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 180px;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.product-category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #FBBF24;
  background: var(--accent-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.product-stock-badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.product-stock-badge.in-stock {
  background: var(--success-light);
  color: #34D399;
}

.product-stock-badge.out-of-stock {
  background: var(--danger-light);
  color: #F87171;
}

.product-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-title);
}

.btn-card-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-card-action:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-card-add:hover {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

/* ==========================================================================
   COMANDA FLUTUANTE DESLIZANTE (OFFCANVAS SIDE DRAWER)
   Abre sobreposta lateralmente com backdrop blur
   ========================================================================== */

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.cart-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  width: 420px;
  max-width: 92vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--transition-drawer);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.cart-drawer-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-cart {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-close-cart:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.cart-items-list {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-empty-state {
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  gap: 0.5rem;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-unit-price {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cart-qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.15rem;
}

.btn-stepper {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 700;
}

.btn-stepper:hover {
  background: var(--bg-hover);
}

.cart-qty-value {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

.cart-item-total {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 65px;
  text-align: right;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
}

.btn-remove-item:hover {
  background: var(--danger-light);
}

/* Rodapé da Comanda & Checkout */
.cart-drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px dashed var(--border-medium);
  padding-top: 0.65rem;
}

.cart-payment-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.btn-checkout-finalize {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  background: var(--success);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-checkout-finalize:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-checkout-finalize:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   BOTÃO FLUTUANTE DA COMANDA (QUANDO HOUVER ITENS)
   ========================================================================== */

.floating-cart-pill {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1200;
  background: var(--primary);
  color: #FFF;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 0.65rem;
  animation: floatBounce 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all var(--transition-fast);
}

.floating-cart-pill:hover {
  transform: scale(1.05);
  background: var(--primary-hover);
}

@keyframes floatBounce {
  from { transform: translateY(20px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
