/* ── Variables ───────────────────────────────────────────── */
:root {
  --cu-co-primary: #e16f37;
  --cu-co-primary-dark: #c0612a;
  --cu-co-primary-light: #fff5f0;
  --cu-co-text: #232221;
  --cu-co-text-muted: #777675;
  --cu-co-text-light: #999;
  --cu-co-border: #e2e1e0;
  --cu-co-bg: #f7f5f4;
  --cu-co-white: #ffffff;
  --cu-co-radius: 12px;
  --cu-co-radius-sm: 8px;
  --cu-co-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  --cu-co-discount: #e16f37;
  --cu-co-success: #2e7d32;
}

/* ── My Addresses module ──────────────────────────────────────────────── */
.form-control.is-invalid {
  border-color: #e3342f !important;
}
.my-addresses-wrapper {
  position: relative;
}

/* Notices */
.ma-notices {
  margin-bottom: 16px;
}

.ma-notices:empty {
  margin: 0;
}

.ma-notice {
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 14px;
}

.ma-notice--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.ma-notice--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Header bar */
.ma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.myAddressModal .modal-body svg {
  display: none;
}
.woocommerce-page form .form-row .input-icon-wrapper input.form-control {
  padding-left: 14px !important;
}
[dir="rtl"]
  .woocommerce-page
  form
  .form-row
  .input-icon-wrapper
  input.form-control {
  padding-right: 14px !important;
}
.myAddressModal input:not([type="checkbox"]):not([type="radio"]),
.myAddressModal select {
  padding: 9px 14px !important;
  -webkit-text-fill-color: #777675 !important;
}
.default-checkbox .form-check {
  display: flex;
  align-items: center;
  padding: 0;
  width: auto !important;
}
.default-checkbox .form-check-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #232221 !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  line-height: 24px !important;
  letter-spacing: 0%;
  vertical-align: middle;
  cursor: pointer;
  margin: 0 !important;
  padding: 0;
}
.default-checkbox.is-dimmed {
  opacity: 0.6;
}

.default-checkbox.is-dimmed .form-check-label {
  cursor: not-allowed;
}
.myAddressModal .modal-footer .btn:not(.ma-save-btn) {
  display: none;
}
/* .default-checkbox .form-check-label::before {
  content: "";
  display: inline-block;
  width: 45px;
  height: 25px;
  background: #d9d8d7;
  border-radius: 20px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s;
  border: none;
}
.default-checkbox .form-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.default-checkbox:has(.form-check-input:checked) .form-check-label::after {
  inset-inline-start: 22px;
}

.default-checkbox .form-check-label::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  top: 2px;
  inset-inline-start: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
} */
.default-checkbox :has(.form-check-input:checked) .form-check-label::before {
  background: var(--cu-co-primary);
}
.myAddressModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: var(--cu-co-white);
  border-radius: var(--cu-co-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 90%;
  max-width: 850px;
  max-height: 85vh;
  display: flex;
}

.myAddressModal .modal-body-form-content {
  max-width: 650px;
  width: 100%;
  margin: auto;
}
@media (max-width: 575.9px) {
  .ma-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ma-header > * {
    width: 100%;
  }
}

.ma-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

/* Address list — single column stack */
.ma-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Individual address card ───────────────────────────────────────────── */
.ma-address-card {
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--Primary-Gray-300, #e2e1e0);
}

.ma-address-card.is-default {
  border-color: #e16f37;
  /* brand orange */
}

/* Card header row: pin+type on left, Delete/Edit on right */
.ma-address-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ma-address-card__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 500;
  line-height: 30px;
}

.ma-pin-icon {
  flex-shrink: 0;
  color: #e07b39;
}

/* Top-right action links */
.ma-address-card__top-actions {
  display: flex;
  gap: 16px;
}

.ma-address-card__top-actions button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  text-transform: capitalize;
  color: #777675;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.ma-address-card__top-actions button:hover {
  color: #e07b39;
}

/* Address / phone lines */
.ma-address-card__details {
  margin-bottom: 12px;
  padding-inline-start: 40px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.ma-address-card__details p {
  margin: 0;
}

[dir="rtl"] .ma-address-card__phone {
  direction: ltr;
  text-align: end;
}

/* Footer: set-as-default toggle */
.ma-address-card__footer {
  padding-inline-start: 40px;
}

/* Set-as-default button with radio circle */
.ma-set-default-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

.ma-set-default-btn:disabled {
  cursor: default;
}

.ma-set-default-btn__circle {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s;
}

/* Filled orange circle when this address is the default */
.ma-set-default-btn.is-active .ma-set-default-btn__circle {
  border-color: #e07b39;
  background: #e07b39;
}

.ma-set-default-btn.is-active .ma-set-default-btn__circle::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Empty state */
.ma-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 50px 0px;
  max-width: 357px;
  margin: 0 auto;
}

.ma-empty__icon {
  margin-bottom: 17px;
  line-height: 1;
}

.ma-empty__title {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.ma-empty__msg {
  color: #777675;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  margin: 0;
}

/* Modal field errors (inline spans kept hidden — errors shown at top instead) */
.ma-field-error {
  display: block;
  color: #c0392b;
  font-size: 12px;
  margin-top: 3px;
}

.ma-field-error:empty {
  display: none;
}

/* Error list shown at the top of the modal */
.ma-error-list {
  margin: 0;
  padding-left: 18px;
}

.ma-error-list li {
  margin-bottom: 2px;
}

/* Red border on phone wrapper when invalid */
.ma-phone-wrapper--error {
  border-color: #e3342f !important;
}

/* Modal notices */
.ma-modal-notices {
  margin-bottom: 10px;
}

.ma-modal-notices:empty {
  margin: 0;
}

.myAddressModal .modal-body {
  padding: 32px 32px 0;
  overflow-y: auto;
  flex: 1;
}

.myAddressModal .gap-3 {
  gap: 1.25rem;
}

.woocommerce-page .myAddressModal .form-row {
  margin-bottom: 20px;
}

.myAddressModal .form-row::before,
.myAddressModal .form-row::after {
  content: none !important;
}

.myAddressModal .form-row .form-group {
  flex: 1;
}

/* Address type radio */
.ma-address-type {
  display: flex;
  gap: 20px;
  align-items: center;
}

.ma-address-type label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  margin: 0;
}

/* Phone field with Egypt flag */
.ma-phone-wrapper {
  display: flex;
  border: 1px solid #e2e1e0;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;

  direction: ltr;
  text-align: start;
}

.ma-phone-wrapper:has(input[readonly]) {
  background: #f0efed;
  cursor: not-allowed;
}

.ma-phone-prefix {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.ma-phone-prefix + .ma-phone-input {
  padding-inline-start: 0 !important;
}

[dir="rtl"] .ma-phone-prefix + .ma-phone-input {
  /* padding-inline-start: 14px !important;
    padding-inline-end: 0 !important;
    text-align: end; */

  text-align: start;
  padding-inline-start: 0 !important;
  padding-inline-end: 14px !important;
}

.ma-phone-flag {
  width: 20px;
  height: 16px;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ma-phone-flag img {
  display: block !important;
  height: 13px !important;
  width: 20px !important;
  object-fit: cover;
  border-radius: 3px;
}

.ma-phone-code {
  --font-family-primary: "Roboto", sans-serif;
  font-size: 14px;
  color: #a09f9e;
  font-weight: 500;
  font-family: var(--font-family-primary);
}

.ma-phone-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}

.ma-phone-input:focus {
  box-shadow: none !important;
  outline: none;
}

.ma-phone-wrapper .ma-field-error {
  display: block;
  width: 100%;
  padding: 2px 10px;
}

/* Pagination */
.ma-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e1e0;
  /* matching $gray-300-color */
}

.ma-pagination .btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
}

[dir="rtl"] .ma-pagination .btn {
  transform: scaleX(-1);
}

.ma-btn-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.ma-page-info {
  font-size: 16px;
  font-weight: 500;
  color: #444342;
  /* matching $gray-800-color */
}
