.address-form {
  background: transparent;
  border-radius: 15px;
  padding: 20px;
  max-width: 900px;
  margin: 20px auto;
  width: 95%;
}

.address-form .section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.address-form .section:last-of-type {
  border-bottom: none;
  margin-bottom: 20px;
}

.address-form h3 {
  margin-bottom: 15px;
  font-size: 1.4em;
  font-weight: 600;
  color: black;
}

.address-form .note {
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #666;
  line-height: 1.4;
}

.address-form .form-group {
  margin-bottom: 15px;
}

.address-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.address-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--y-main);
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.address-form input:focus {
  border-color: var(--y-secondary);
  box-shadow: 0 0 10px rgba(190, 134, 71, 0.3);
  outline: none;
}

.address-form input::placeholder {
  color: #999;
  font-style: italic;
}

.address-form .form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  width: 100%;
}

.address-form .form-row .form-group {
  flex: 1 1 48%;
}

/* WooCommerce address form field compatibility — تصميم إضافة العنوان */
.address-form .woocommerce-address-fields__field-wrapper .form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 0;
}
.address-form .woocommerce-address-fields__field-wrapper .form-row label {
  margin-bottom: 0.5rem;
}
.address-form .woocommerce-address-fields__field-wrapper .form-row .woocommerce-input-wrapper {
  width: 100%;
}
.address-form .woocommerce-address-fields__field-wrapper .form-row .woocommerce-input-wrapper input,
.address-form .woocommerce-address-fields__field-wrapper .form-row .woocommerce-input-wrapper select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--y-main);
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.5;
  box-sizing: border-box;
}
.address-form .address-form-fields .form-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.address-form .address-form-fields .form-row .form-group {
  flex: 1 1 calc(50% - 12px);
  min-width: 200px;
  margin-bottom: 16px;
}
.address-form .address-form-fields .form-group.full-width {
  flex: 1 1 100%;
  margin-bottom: 16px;
}
.address-form .address-form-fields .form-group.full-width .form-row {
  width: 100%;
}
.address-form .country-text {
  margin: 0.5rem 0 0;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  font-weight: 500;
  color: var(--y-color-text-dark);
}
.address-form .address-country-hidden,
.address-form input.address-country-hidden {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
}
.address-empty-state .section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--y-color-text-dark);
  margin-bottom: 1.5rem;
}
.address-form .form-group .form-row {
  margin: 0;
  width: 100%;
}
.address-form .form-group .form-row .woocommerce-input-wrapper {
  margin-bottom: 0;
}

.address-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 20px;
}

@media (max-width: 820px) {
  .address-form {
    padding: 15px;
    margin: 10px auto;
    width: 98%;
    box-sizing: border-box;
    max-width: 100%;
  }

  .address-form .section h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .address-form .section {
    margin-bottom: 25px;
    padding-bottom: 20px;
  }

  .address-form .note {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .address-form .form-row {
    flex-direction: column;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form .form-row .form-group {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .address-form .form-group {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form label {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
  }

  .address-form input {
    font-size: 14px;
    padding: 12px;
    border-radius: 10px;
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }

  .address-form .form-actions {
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form .btn-primary,
  .address-form .btn-secondary {
    width: 100%;
    font-size: 14px;
    padding: 14px;
    min-height: 48px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .btn-save {
    width: 100%;
    font-size: 14px;
    padding: 14px;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .address-form {
    padding: 12px;
    margin: 5px auto;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form .section h3 {
    font-size: 16px;
    text-align: center;
  }

  .address-form .note {
    font-size: 12px;
    text-align: center;
    padding: 0 10px;
  }

  .address-form label {
    font-size: 13px;
  }

  .address-form input {
    font-size: 14px;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }

  .address-form .form-group {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form .form-actions {
    gap: 12px;
    margin-top: 25px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form .btn-primary,
  .address-form .btn-secondary {
    font-size: 13px;
    padding: 12px;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
  }

  .btn-save {
    font-size: 13px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 820px) and (orientation: landscape) {
  .address-form {
    max-height: 90vh;
    overflow-y: auto;
    padding: 15px;
    box-sizing: border-box;
  }

  .address-form .section {
    margin-bottom: 20px;
  }

  .address-form input {
    padding: 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-form .btn-primary,
  .address-form .btn-secondary {
    padding: 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }
}
.btn-save {
  background: var(--y-secondary);
  color: white;
  padding: 0.875rem 3rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s 
ease;
  margin-top: 1rem;
}
/* Current address / invoice card styles */
.address-empty-state {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.address-filled-state {
  max-width: 900px;
}

.address-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 2rem;
}

.address-header .buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-edit {
  background: transparent;
  color: var(--y-secondary);
  padding: 0.75rem 2rem;
  border: 2px solid var(--y-secondary);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-edit:hover {
  background: var(--y-secondary);
  color: white;
}

.btn-clear {
  background: transparent;
  color: #b91c1c;
  padding: 0.75rem 2rem;
  border: 2px solid #b91c1c;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

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

.address-display-card {
  background: transparent;
  border: 2px solid var(--y-secondary);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding-top: 4rem;
}

.address-display-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.address-close {
  position: absolute;
  inset-block-start: 1.25rem;
  inset-inline-end: 1.25rem;
  background: #d32f2f;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;

}

.address-close:hover {
  background: #b71c1c;
  transform: scale(1.1);
}

.address-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--y-color-text-dark);
  margin-bottom: 1.5rem;
  text-align: right;
  padding-left: 3rem;
}

.address-info {
  text-align: center;
  padding: 1rem 0;
}

.address-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--y-color-text-dark);
  margin-bottom: 1rem;
}

.address-line {
  font-size: 1.15rem;
  color: var(--y-color-text-dark);
  margin-bottom: 0.625rem;
  font-weight: 500;
}

.address-form {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--y-radius-20);
}

/* Address list empty state */
.address-empty-message {
  padding: 1rem 0;
  color: var(--y-color-muted, #666);
  font-size: 1rem;
  margin: 0;
}

@media (max-width: 991.98px) {
  .address-filled-state {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .address-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    width: 100%;
    box-sizing: border-box;
  }

  .address-header .buttons {
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .btn-edit {
    width: auto;
    min-width: 120px;
    padding: 0.65rem 1.5rem;
    font-size: 14px;
    box-sizing: border-box;
  }

  .address-display-card {
    padding: 1.5rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .address-card-title {
    padding-left: 0;
    margin-bottom: 1rem;
    font-size: 16px;
  }

  .address-info {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }

  .address-name {
    font-size: 16px;
  }

  .address-line {
    font-size: 14px;
  }

  .address-close {
    inset-block-start: 0.85rem;
    inset-inline-start: 0.85rem;
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}

@media (max-width: 575.98px) {
  .address-display-card {
    padding: 1rem 0.75rem;
    border-width: 1px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .address-header {
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  .address-header .buttons {
    gap: 0.5rem;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
  }

  .btn-edit {
    width: 100%;
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 13px;
    box-sizing: border-box;
  }

  .address-card-title {
    font-size: 15px;
  }

  .address-name {
    font-size: 15px;
  }

  .address-line {
    font-size: 13px;
  }

  .address-close {
    inset-block-start: 0.65rem;
    inset-inline-start: 0.65rem;
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}
