/* Account navigation follows the public menu; checkout and other buttons are untouched. */
.account-title-actions .account-section-tabs .btn.btn-light,
.account-title-actions .account-logout-button.btn.btn-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #d2e1ef;
  border-radius: 8px;
  background: #f5f9fd;
  color: #0056a6 !important;
  -webkit-text-fill-color: currentColor;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.account-title-actions .account-section-tabs .btn.btn-light.is-active,
.account-title-actions .account-section-tabs .btn.btn-light[aria-current="page"],
.account-title-actions .account-section-tabs .btn.btn-light:hover,
.account-title-actions .account-section-tabs .btn.btn-light:focus-visible,
.account-title-actions .account-logout-button.btn.btn-light:hover,
.account-title-actions .account-logout-button.btn.btn-light:focus-visible {
  border-color: #0056d6;
  background: #0056d6;
  color: #fff !important;
}

.account-title-actions .account-section-tabs .btn.btn-light:focus-visible,
.account-title-actions .account-logout-button.btn.btn-light:focus-visible {
  outline: 2px solid #0056a6;
  outline-offset: 3px;
}

.account-form .tr-address-field {
  min-width: 0;
}

/* Explicit geometry removes Safari's compact native popup-button rendering. */
.account-form .tr-address-field select {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 10px 40px 10px 12px;
  border: 1px solid #d6dce4;
  border-radius: 9px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23516075' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  color: #10243f;
  -webkit-text-fill-color: currentColor;
  font-family: inherit;
  font-size: 16px !important;
  font-weight: 400;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
}

.account-form .tr-address-field select:focus-visible {
  border-color: #0056a6;
  outline: 2px solid #0056a6;
  outline-offset: 2px;
}

.account-form .tr-address-field select:disabled {
  background-color: #f1f4f8;
  color: #617087;
  opacity: 1;
}

@media (max-width: 980px) {
  .account-title-row .account-title-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .account-title-actions .account-section-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    flex: 1 1 100%;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    overflow: visible !important;
  }

  .account-title-actions .account-section-tabs .btn.btn-light {
    width: 100%;
    min-width: 0;
    min-height: 44px !important;
    height: auto !important;
    white-space: normal !important;
  }

  .account-title-actions .account-logout-button.btn.btn-light {
    flex: 0 0 auto;
    align-self: start;
    justify-self: end;
    width: auto !important;
    min-width: 80px !important;
    min-height: 44px !important;
    height: auto !important;
    margin: 0;
  }
}

@media (max-width: 760px) {
  .account-title-actions .account-section-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (forced-colors: active) {
  .account-form .tr-address-field select {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-title-actions .account-section-tabs .btn.btn-light,
  .account-title-actions .account-logout-button.btn.btn-light {
    transition: none;
  }
}

/* Override the legacy compact form rule only for account address entry. */
.account-form .field.tr-address-line textarea {
  font-size: 16px !important;
  line-height: 1.5;
}

/* Keep logout beside the title, without a third navigation row on phones. */
@media (max-width: 760px) {
  .account-title-row {
    position: relative;
    display: block !important;
  }

  .account-title-row > div:first-child {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    padding-right: 90px;
  }

  .account-title-row .section-title {
    margin: 0;
    overflow-wrap: anywhere;
  }

  .account-title-row .account-title-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    margin-top: 10px;
  }

  .account-title-row .account-title-actions .account-section-tabs {
    justify-self: stretch;
    width: 100% !important;
    max-width: none !important;
    margin: 0;
  }

  .account-title-row .account-title-actions .account-logout-button.btn.btn-light {
    position: absolute;
    top: 0;
    right: 0;
    gap: 6px;
    min-width: 80px !important;
    min-height: 44px !important;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .account-title-row .account-logout-button::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5H5v14h4M9 12h12m-4-4 4 4-4 4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5H5v14h4M9 12h12m-4-4 4 4-4 4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  }
}
