/* ============================================================================
   FIELDCHECK - STYLES.CSS
   Sistema mobile-first para auditorias de PDV
   ============================================================================ */

:root {
  --primary-color: #00A550;
  --primary-dark: #008040;
  --secondary-color: #666;
  --danger-color: #dc3545;
  --border-color: #ddd;
  --bg-gray: #f5f5f5;
  --text-color: #333;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background: var(--bg-gray);
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.header {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header .logo {
  height: 40px;
  object-fit: contain;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
  min-width: 200px;
}

.header .btn-upload {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s;
}

.header .btn-upload:hover {
  background: rgba(255, 255, 255, 0.3);
}

.header-error {
  background: var(--danger-color);
}

/* LOADING OVERLAY */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  border: 4px solid var(--bg-gray);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-spinner p {
  color: var(--text-color);
  font-weight: 500;
  margin: 0;
}

/* CONTAINER */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* CARD */
.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem 0;
  color: var(--secondary-color);
}

/* FIELDS */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.field input:disabled {
  background: var(--bg-gray);
  color: var(--secondary-color);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field-inline {
  display: flex;
  gap: 0.5rem;
}

.field-inline input {
  flex: 1;
}

/* RADIO & CHECKBOX GROUPS */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.radio-group label,
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

/* BUTTONS */
button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: white;
  color: var(--secondary-color);
  border: 1px solid var(--border-color);
}

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

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

.btn-delete {
  background: var(--danger-color);
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 4px;
}

.btn-delete:hover {
  background: #c82333;
}

/* AUTOCOMPLETE */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  z-index: 10;
}

.autocomplete-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-gray);
}

.autocomplete-item:hover {
  background: var(--bg-gray);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

/* INFO BOX */
.info-box {
  background: var(--bg-gray);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.info-box h3 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
}

.info-box p {
  margin: 0.25rem 0;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1;
}

/* PRODUTOS */
.produtos-list {
  margin-top: 1rem;
}

.produto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  background: white;
}

.produto-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.produto-preco {
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 0.25rem;
}

.produto-form {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-gray);
  border-radius: 4px;
}

.empty-message {
  text-align: center;
  color: var(--secondary-color);
  padding: 2rem;
}

/* PREÇOS */
.precos-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.preco-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-gray);
  border-radius: 4px;
}

.preco-item span {
  font-weight: 500;
}

.preco-item input {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
}

/* UTILITY CLASSES */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.p-1 { padding: 1rem; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .container {
    padding: 0.5rem;
  }

  .card {
    padding: 1rem;
    border-radius: 0;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .preco-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .preco-item input {
    width: 100%;
  }
}
/* PDVs PRÓXIMOS */
.pdv-proximo-item {
  transition: background-color 0.2s;
}

.pdv-proximo-item:hover {
  background-color: #f5f5f5 !important;
}

.pdv-proximo-item:active {
  background-color: #e8e8e8 !important;
}