/* ===================================
   ENDEREÇOS SECTION
   =================================== */

.addresses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.addresses-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.add-address-btn {
  background-color: #004F6B;
  color: #ffffff;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-address-btn:hover {
  background-color: #e6a708;
}

/* ===================================
   MODAL STYLES
   =================================== */

.address-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999999 !important;
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 9999999 !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #111827;
}

/* ===================================
   ADDRESS FORM
   =================================== */

.address-form {
  padding: 24px;
}

.address-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.address-form .form-row:has(.form-group:only-child) {
  grid-template-columns: 1fr;
}

.address-form .form-group {
  display: flex;
  flex-direction: column;
}

.address-form .form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.address-form .form-group label .required {
  color: #ef4444;
  margin-right: 4px;
}

.address-form .form-group input,
.address-form .form-group select {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #111827;
  transition: border-color 0.2s;
  height: auto;
  line-height: normal;
}

.address-form .form-group select {
  padding-top: 10px;
  padding-bottom: 10px;
}

.address-form .form-group input:focus,
.address-form .form-group select:focus {
  outline: none;
  border-color: #004F6B;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.btn-cancel,
.btn-save {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-cancel {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-cancel:hover {
  background-color: #e5e7eb;
}

.btn-save {
  background-color: #004F6B;
  color: #ffffff;
}

.btn-save:hover {
  background-color: #e6a708;
}

/* ===================================
   ADDRESSES LIST
   =================================== */

.addresses-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.loading-addresses {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 16px;
}

.loading-addresses i {
  margin-right: 8px;
}

.no-addresses {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.no-addresses i {
  font-size: 48px;
  color: #d1d5db;
  margin-bottom: 16px;
  display: block;
}

.no-addresses p {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
}

/* ===================================
   ADDRESS CARD
   =================================== */

.address-card {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
  position: relative;
}

.address-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.address-card.active {
  border-color: #22c55e;
  background-color: #f0fdf4;
}

.address-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: #22c55e;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.address-info {
  margin-bottom: 16px;
}

.address-name {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.address-company {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
  font-style: italic;
}

.address-details {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.address-details div {
  margin-bottom: 4px;
}

.address-phone,
.address-email {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.address-phone i,
.address-email i {
  color: #6b7280;
  font-size: 12px;
}

.address-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.address-card.active .address-actions {
  border-top-color: #bbf7d0;
}

.address-actions button {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-activate {
  background-color: #22c55e;
  color: #ffffff;
}

.btn-activate:hover {
  background-color: #16a34a;
}

.btn-edit-address {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-edit-address:hover {
  background-color: #e5e7eb;
}

.btn-delete-address {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-delete-address:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Hide activate button on active address */
.address-card.active .btn-activate {
  display: none;
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */

@media (max-width: 768px) {
  .addresses-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .add-address-btn {
    width: 100%;
    justify-content: center;
  }

  .addresses-list {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 20px;
  }

  .address-form {
    padding: 20px;
  }

  .address-form .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .address-actions {
    flex-direction: column;
  }

  .address-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .addresses-title {
    font-size: 20px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-title {
    font-size: 18px;
  }

  .address-form {
    padding: 16px;
  }
}
