.envios-detalle-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 140px;
}

/* ==========================================
   HEADER
========================================== */

.envios-detalle-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.envios-detalle-header-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.envios-detalle-back-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}

.envios-detalle-back-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.envios-detalle-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.envios-detalle-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.envios-detalle-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================
   CARDS
========================================== */

.envios-detalle-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #eef2f7;
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.04),
    0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: visible;
}

.envios-detalle-card-header {
  padding: 16px 16px 0;
}

.envios-detalle-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.envios-detalle-card-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.envios-detalle-card-body {
  padding: 16px;
}

/* ==========================================
   GRID
========================================== */

.envios-detalle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.envios-detalle-coverage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* ==========================================
   FIELDS
========================================== */

.envios-detalle-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.envios-detalle-label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.envios-detalle-input,
.envios-detalle-textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #ffffff;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.envios-detalle-input {
  height: 42px;
  padding: 0 14px;
}

.envios-detalle-textarea {
  min-height: 90px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.5;
}

.envios-detalle-input:focus,
.envios-detalle-textarea:focus {
  border-color: var(--color_primario);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ==========================================
   SWITCH
========================================== */

.envios-detalle-switch-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.envios-detalle-switch-row .global-switch {
  margin-left: auto;
  flex-shrink: 0;
}

.envios-detalle-switch-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

/* ==========================================
   COVERAGE
========================================== */

.envios-detalle-coverage-card {
  border: 1px solid #eef2f7;
  border-radius: 16px;
  padding: 14px;
  background: #fcfcfd;
}

.envios-detalle-coverage-header {
  margin-bottom: 12px;
}

.envios-detalle-coverage-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.envios-detalle-coverage-subtitle {
  margin: 4px 0 0;
  font-size: 11px;
  color: #6b7280;
}

.envios-detalle-chip-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.envios-detalle-chip-input-wrapper .global-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

.envios-detalle-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  min-height: 20px;
}

.envios-detalle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.envios-detalle-chip button {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.envios-detalle-chip button:hover {
  color: #dc2626;
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {
  .envios-detalle-page {
    padding: 14px;
    gap: 14px;
  }

  .envios-detalle-header {
    flex-direction: column;
    align-items: stretch;
  }

  .envios-detalle-header-actions {
    width: 100%;
  }

  .envios-detalle-header-actions .global-btn {
    width: 100%;
    justify-content: center;
  }

  .envios-detalle-title {
    font-size: 22px;
  }

  .envios-detalle-grid,
  .envios-detalle-coverage-grid {
    grid-template-columns: 1fr;
  }

  .envios-detalle-card-header {
    padding: 14px 14px 0;
  }

  .envios-detalle-card-body {
    padding: 14px;
  }

  .envios-detalle-coverage-card {
    padding: 12px;
  }
}
