/**
 * My Account responsive styles
 * Enqueued only on WooCommerce account pages — see app/setup.php (is_account_page)
 */

/* ---------- Wrapper ---------- */
.wc-myacc-wrapper {
  overflow: hidden;
}

/* ---------- Navigation ---------- */
.woocommerce-MyAccount-navigation ul.nav {
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

.woocommerce-MyAccount-navigation .nav-item {
  padding: 0;
  margin: 0 0 0.25rem;
  border-radius: 4px;
}

.woocommerce-MyAccount-navigation .nav-item a {
  display: block;
  padding: 0.75rem 1rem;
  color: #212529;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.woocommerce-MyAccount-navigation .nav-item a:hover {
  background-color: #f1f1f1;
  color: #448aa6;
}

.woocommerce-MyAccount-navigation .nav-item.is-active a,
.woocommerce-MyAccount-navigation .nav-item.is-active:hover a {
  color: #fff;
}

/* Mobile: stacked nav with bottom border instead of right border */
@media (max-width: 991.98px) {
  .wc-myacc-wrapper {
    border-radius: 6px;
  }

  .wc-myacc-wrapper .woocommerce-MyAccount-navigation {
    border-right: 0 !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 0.75rem !important;
    background-color: #f8f6f6;
  }

  .woocommerce-MyAccount-navigation ul.nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .woocommerce-MyAccount-navigation .nav-item {
    flex: 1 1 auto;
    margin: 0;
    text-align: center;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .woocommerce-MyAccount-navigation .nav-item a {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .woocommerce-MyAccount-content {
    padding: 1.25rem !important;
  }
}

/* Desktop: vertical divider between nav and content while flex row is active */
@media (min-width: 992px) {
  .wc-myacc-wrapper .woocommerce-MyAccount-navigation {
    border-right: 1px solid #dee2e6 !important;
    border-bottom: 0 !important;
  }
}

/* ---------- Content area ---------- */
.woocommerce-MyAccount-content {
  word-wrap: break-word;
}

.woocommerce-MyAccount-content table {
  width: 100%;
}

/* Orders / Downloads tables — let them scroll horizontally on small screens
   rather than overflowing the layout. */
@media (max-width: 767.98px) {
  .woocommerce-MyAccount-content .woocommerce-orders-table,
  .woocommerce-MyAccount-content .shop_table,
  .woocommerce-MyAccount-content .woocommerce-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .woocommerce-MyAccount-content .woocommerce-orders-table td,
  .woocommerce-MyAccount-content .shop_table td,
  .woocommerce-MyAccount-content .woocommerce-table td {
    white-space: normal;
  }

  .woocommerce-MyAccount-content .woocommerce-orders-table .button,
  .woocommerce-MyAccount-content .shop_table .button {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.85rem !important;
  }
}

/* ---------- Edit-account form ---------- */
/* WC's form-row-first / form-row-last sit side-by-side at all widths — stack
   them on mobile so labels and inputs are readable. */
.woocommerce-EditAccountForm .form-row {
  margin-bottom: 1rem;
}

.woocommerce-EditAccountForm .form-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.woocommerce-EditAccountForm .form-row input.input-text {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
}

.woocommerce-EditAccountForm fieldset {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.woocommerce-EditAccountForm fieldset legend {
  width: auto;
  padding: 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .woocommerce-EditAccountForm .form-row-first,
  .woocommerce-EditAccountForm .form-row-last {
    float: none !important;
    width: 100% !important;
  }
}

/* ---------- Addresses (my-address) ---------- */
.woocommerce-Addresses {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.woocommerce-Addresses .woocommerce-Address {
  flex: 1 1 100%;
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .woocommerce-Addresses .woocommerce-Address {
    flex: 1 1 50%;
    max-width: 50%;
  }
}

.woocommerce-Address-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.woocommerce-Address-title .edit {
  font-size: 0.9rem;
}

/* ---------- Dashboard intro text ---------- */
.woocommerce-MyAccount-content > p:first-of-type {
  margin-bottom: 1.25rem;
}

/* ---------- Buttons on small screens ---------- */
@media (max-width: 575.98px) {
  .woocommerce-MyAccount-content .button,
  .woocommerce-MyAccount-content .btn {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }
}
