/* ===================================
   PDV - Frente de Caixa - Styles
   =================================== */

/* Layout base */
.page {
  height: 100vh;
  overflow: hidden;
}

/* ==================== HEADER COMPACTO EM UMA LINHA ==================== */
.compact-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  padding: 0.8rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid rgba(252, 199, 92, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
}

.header-inline {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.menu-hamburger {
  background: rgba(252, 199, 92, 0.1);
  border: 1px solid rgba(252, 199, 92, 0.3);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  color: #FCC75C;
}

.menu-hamburger:hover {
  background: rgba(252, 199, 92, 0.2);
  transform: scale(1.05);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
}

.header-logo {
  width: 35px;
  height: 35px;
  filter: drop-shadow(0 2px 4px rgba(252, 199, 92, 0.4));
}

.dashboard-label {
  color: #FCC75C;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.back-button {
  background: rgba(252, 199, 92, 0.1);
  border: 1px solid rgba(252, 199, 92, 0.3);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  color: #FCC75C;
  flex-shrink: 0;
}

.back-button:hover {
  background: rgba(252, 199, 92, 0.2);
  transform: scale(1.05);
}

.back-button:active {
  transform: scale(0.95);
}

/* Barra de Saudação PDV */
.greeting-bar {
  background: linear-gradient(135deg, rgba(252, 199, 92, 0.1), rgba(252, 199, 92, 0.05));
  border-bottom: 1px solid rgba(252, 199, 92, 0.2);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  backdrop-filter: blur(10px);
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
}

.pdv-greeting-bar {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

.greeting-icon {
  font-size: 1.2rem;
}

.greeting-text {
  color: #4caf50;
  font-size: 1.1rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.greeting-divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
}

.greeting-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Seção de Busca */
.pdv-search-section {
  margin-bottom: 0.8em;
  flex-shrink: 0;
}

.pdv-content {
  padding-top: 0.5em !important;
  padding-bottom: 0.5em !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 110px !important; /* Espaço para compact-header (60px) + greeting-bar (~50px) */
}

.pdv-cart-items {
  max-height: calc(100vh - 360px);
  overflow-y: auto;
  padding-right: 0.5em;
  margin-bottom: 1em;
}

.pdv-search-bar {
  display: flex;
  gap: 0.5em;
  align-items: center;
  margin-bottom: 1em;
}

.pdv-search-input-container {
  flex: 1;
  position: relative;
}

.pdv-search-input {
  width: 100%;
  padding: 0.8em 2.5em 0.8em 1em;
  border: none;
  border-radius: 8px;
  background: #eeeeee;
  font-size: 16px;
  color: #333;
  outline: none;
  transition: all 0.3s ease;
}

.pdv-search-input:focus {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.pdv-search-icon {
  position: absolute;
  right: 0.8em;
  top: 50%;
  transform: translateY(-50%);
  color: #757575;
  font-size: 1.5em;
  pointer-events: none;
}

.pdv-scan-btn {
  background: #ff9800;
  border: none;
  border-radius: 8px;
  width: 3.5em;
  height: 3.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pdv-scan-btn:hover {
  background: #fb8c00;
  transform: scale(1.05);
}

.pdv-scan-btn:active {
  transform: scale(0.95);
}

.pdv-search-results {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 0.8em;
}

.pdv-search-item {
  cursor: pointer;
  transition: all 0.3s ease;
}

.pdv-search-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pdv-search-item:active {
  transform: scale(0.98);
}

/* Seção do Carrinho PDV */
.pdv-cart-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdv-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #424242;
  padding: 0.8em 1em;
  border-radius: 8px;
  margin-bottom: 0.8em;
  flex-shrink: 0;
}

.pdv-cart-title {
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  margin: 0;
}

.pdv-clear-btn {
  background: transparent;
  border: 1px solid #f44336;
  color: #f44336;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.pdv-clear-btn:hover {
  background: #f44336;
  color: white;
}

.pdv-cart-items {
  max-height: calc(100vh - 28em);
  overflow-y: auto;
  padding-right: 0.5em;
}

/* Estado vazio do carrinho */
.pdv-empty-cart {
  background: #424242;
  border-radius: 8px;
  padding: 2em 1em;
  text-align: center;
  color: #9e9e9e;
  min-height: 8em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pdv-empty-cart i {
  font-size: 4em;
  margin-bottom: 0.5em;
  opacity: 0.5;
}

.pdv-empty-cart p {
  margin: 0;
  font-size: 1em;
}

/* Item do carrinho */
.pdv-cart-item {
  background: #eeeeee;
  border-radius: 8px;
  padding: 0.8em;
  margin-bottom: 0.8em;
  display: flex;
  gap: 0.8em;
  align-items: center;
  animation: fadeIn 0.3s ease;
  transition: all 0.3s ease;
}

.pdv-cart-item:hover {
  background: #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdv-item-image {
  flex-shrink: 0;
  width: 4em;
  height: 4em;
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.pdv-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.pdv-item-name {
  margin: 0 0 0.2em 0;
  font-size: 1em;
  font-weight: bold;
  color: #212121;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdv-item-desc {
  margin: 0 0 0.4em 0;
  font-size: 0.85em;
  color: #757575;
}

.pdv-item-price {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9em;
  flex-wrap: wrap;
}

.price-unit {
  color: #616161;
  font-weight: 500;
}

.price-separator {
  color: #9e9e9e;
}

.price-qty {
  color: #212121;
  font-weight: bold;
}

.price-subtotal {
  color: #ff9800;
  font-weight: bold;
  font-size: 1.1em;
}

.pdv-item-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  align-items: center;
}

.pdv-btn-remove {
  background: transparent;
  border: 1px solid #f44336;
  color: #f44336;
  border-radius: 6px;
  width: 2.5em;
  height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pdv-btn-remove:hover {
  background: #f44336;
  color: white;
  transform: scale(1.05);
}

/* Controles de Quantidade */
.pdv-quantity-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 0.3em;
}

.pdv-btn-minus,
.pdv-btn-plus {
  background: #424242;
  border: none;
  border-radius: 50%;
  width: 2.2em;
  height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1em;
}

.pdv-btn-minus:hover,
.pdv-btn-plus:hover {
  background: #616161;
  transform: scale(1.1);
}

.pdv-btn-minus:active,
.pdv-btn-plus:active {
  transform: scale(0.95);
}

.pdv-btn-plus {
  background: #4caf50;
}

.pdv-btn-plus:hover {
  background: #66bb6a;
}

.pdv-btn-minus {
  background: #f44336;
}

.pdv-btn-minus:hover {
  background: #ef5350;
}

.pdv-qty {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  min-width: 2.5em;
  text-align: center;
  padding: 0.2em 0;
}

/* Footer PDV */
#pdvFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  padding: 0.8em 1em;
  background: #000 !important;
}

.pdv-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  max-width: 100%;
}

.pdv-total-section {
  flex: 1;
}

.pdv-total-label {
  display: block;
  color: #9e9e9e;
  font-size: 0.85em;
  margin-bottom: 0.3em;
}

.pdv-total-value {
  display: flex;
  align-items: baseline;
  gap: 0.2em;
}

.pdv-total-currency {
  color: white;
  font-size: 1.2em;
  font-weight: normal;
}

.pdv-total-int {
  color: white;
  font-size: 2.2em;
  font-weight: bold;
  line-height: 1;
}

.pdv-total-sep {
  color: white;
  font-size: 1.5em;
  font-weight: bold;
}

.pdv-total-cent {
  color: white;
  font-size: 1.5em;
  font-weight: bold;
}

.pdv-finalize-btn {
  background: #4caf50;
  border: none;
  border-radius: 8px;
  padding: 0.8em 1.5em;
  color: white;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  min-height: 3.5em;
}

.pdv-finalize-btn i {
  font-size: 1.5em;
}

.pdv-finalize-btn:hover {
  background: #66bb6a;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.pdv-finalize-btn:active {
  transform: translateY(0);
}

.pdv-finalize-btn:disabled {
  background: #616161 !important;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pdv-search-item,
.pdv-cart-items .item {
  animation: fadeIn 0.3s ease;
}

/* Scrollbar personalizada */
.pdv-search-results::-webkit-scrollbar,
.pdv-cart-items::-webkit-scrollbar {
  width: 6px;
}

.pdv-search-results::-webkit-scrollbar-track,
.pdv-cart-items::-webkit-scrollbar-track {
  background: #424242;
  border-radius: 10px;
}

.pdv-search-results::-webkit-scrollbar-thumb,
.pdv-cart-items::-webkit-scrollbar-thumb {
  background: #ff9800;
  border-radius: 10px;
}

.pdv-search-results::-webkit-scrollbar-thumb:hover,
.pdv-cart-items::-webkit-scrollbar-thumb:hover {
  background: #fb8c00;
}

/* Badge de quantidade */
.pdv-item-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff9800;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Loading State */
.pdv-loading {
  text-align: center;
  padding: 2em;
  color: #9e9e9e;
}

.pdv-loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.pdv-empty-state {
  text-align: center;
  padding: 3em 1em;
  color: #9e9e9e;
}

.pdv-empty-state i {
  font-size: 4em;
  margin-bottom: 0.5em;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 480px) {
  .pdv-cart-items {
    max-height: calc(100vh - 380px);
  }
  
  .pdv-search-results {
    max-height: 180px;
  }
  
  .pdv-footer-content {
    flex-direction: column;
    gap: 0.6em;
  }
  
  .pdv-finalize-btn {
    width: 100%;
    justify-content: center;
    padding: 0.6em 1em;
    min-height: 3em;
  }
  
  .pdv-total-section {
    width: 100%;
    text-align: center;
  }
  
  .pdv-total-value {
    justify-content: center;
  }
  
  .pdv-total-int {
    font-size: 1.8em;
  }
  
  .pdv-total-sep,
  .pdv-total-cent {
    font-size: 1.3em;
  }
  
  .pdv-cart-item {
    flex-wrap: wrap;
  }
  
  .pdv-item-controls {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }
  
  .pdv-item-info {
    width: 100%;
  }
  
  .greeting-text {
    font-size: 1rem;
  }
  
  .greeting-date {
    font-size: 0.85rem;
  }
  
  #pdvFooter {
    padding: 0.6em 0.8em;
  }
  
  .compact-header {
    padding: 0.6rem 1rem;
    height: 55px;
  }
  
  .menu-hamburger,
  .back-button {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }
  
  .header-logo {
    width: 30px;
    height: 30px;
  }
  
  .dashboard-label {
    font-size: 1rem;
  }
  
  .pdv-content {
    margin-top: 100px !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .pdv-cart-items {
    max-height: calc(100vh - 370px);
  }
  
  .pdv-total-int {
    font-size: 2em;
  }
}

@media (min-width: 769px) {
  .pdv-cart-items {
    max-height: calc(100vh - 360px);
  }
}
