/* Estilos do carrinho */
.cart-icon {
  position: relative;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
}

.cart-icon:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  animation: pulse 2s infinite;
  border: 2px solid var(--bg);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Cart Modal */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cart-modal.active {
  display: flex;
}

.cart-content {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Product Detail Modal */
.product-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-detail-content {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.product-detail-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-detail-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0.5rem;
  border-radius: 6px;
}

.product-detail-close:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
}

.product-detail-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.product-detail-image {
  background: linear-gradient(45deg, #333, #555);
  border-radius: 12px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--muted);
}

.product-detail-info h2 {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.product-detail-category {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.product-detail-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--fg);
  margin-bottom: 1rem;
}

.product-detail-description {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.product-detail-stock {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--muted);
}

.product-detail-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-detail-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Customer Info Modal */
.customer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.customer-content {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  max-width: 500px;
  width: 100%;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.customer-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.customer-body {
  padding: 1.5rem;
}

.customer-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customer-form label {
  font-weight: bold;
  margin-bottom: 0.5rem;
  display: block;
}

.customer-form input {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.customer-form input:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.customer-form input::placeholder {
  color: var(--muted);
}

.customer-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.customer-actions .btn {
  flex: 1;
}

/* Cart Summary Modal */
.cart-summary-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cart-summary-content {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.cart-summary-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.cart-summary-body {
  padding: 1.5rem;
}

.customer-info-display {
  background: #1a3a1a;
  border: 1px solid #4CAF50;
  color: #4CAF50;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.qr-code-container {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.qr-code-container canvas {
  background: white;
  border-radius: 8px;
  padding: 10px;
}

.share-link-container {
  background: #222;
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  word-break: break-all;
}

.share-link-container input {
  background: transparent;
  border: none;
  color: #4CAF50;
  font-family: monospace;
  width: 100%;
  font-size: 0.9rem;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0.5rem;
  border-radius: 6px;
}

.cart-close:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
}

.cart-body {
  padding: 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #111;
  transition: all 0.3s ease;
}

.cart-item:hover {
  background: #1a1a1a;
  border-color: var(--muted);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #333, #555);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--muted);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-category {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.cart-item-price {
  color: var(--fg);
  font-weight: bold;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.25rem;
}

.quantity-btn {
  background: none;
  border: none;
  color: var(--fg);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.quantity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quantity-input {
  background: none;
  border: none;
  color: var(--fg);
  width: 40px;
  text-align: center;
  font-weight: bold;
}

.cart-item-remove {
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cart-item-remove:hover {
  background: #c82333;
  transform: scale(1.05);
}

.cart-summary {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  background: #111;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.cart-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cart-actions .btn {
  flex: 1;
  min-width: 150px;
}

.cart-id {
  background: #1a1a1a;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-id strong {
  color: var(--fg);
  font-size: 1.1rem;
}

.share-url {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg);
  padding: 0.5rem;
  border-radius: 6px;
  width: 100%;
  margin-top: 0.5rem;
  font-family: monospace;
  font-size: 0.9rem;
}

.empty-cart {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

.empty-cart i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.btn-danger {
  background: #dc3545;
  border-color: #dc3545;
}

.btn-danger:hover {
  background: #c82333;
  border-color: #c82333;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  color: var(--fg);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 320px;
  word-wrap: break-word;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid #28a745;
  background: #111;
}

.toast.error {
  border-left: 4px solid #dc3545;
  background: #111;
}

.toast.info {
  border-left: 4px solid var(--fg);
  background: #111;
}

.toast.warning {
  border-left: 4px solid #FF9800;
  background: #111;
}

/* Responsive para o carrinho */
@media (max-width: 768px) {

  .cart-content,
  .product-detail-content,
  .customer-content,
  .cart-summary-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }

  .product-detail-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cart-actions,
  .customer-actions {
    flex-direction: column;
  }

  .cart-actions .btn,
  .customer-actions .btn {
    min-width: auto;
  }

  .cart-item {
    flex-direction: column;
    text-align: center;
  }

  .cart-item-image {
    align-self: center;
  }

  .cart-item-controls {
    justify-content: center;
  }

  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
    top: 10px;
    transform: translateY(-100px);
  }

  .toast.show {
    transform: translateY(0);
  }

  .cart-icon {
    padding: 0.75rem;
  }

  .cart-badge {
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
  }
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-icon:focus,
.cart-close:focus,
.product-detail-close:focus {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.quantity-input:focus,
.customer-form input:focus {
  outline: 1px solid var(--fg);
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--fg);
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}