/* ============================================================
   Customer account (WooCommerce My Account + checkout auth)
   Styles WooCommerce's default markup to match the site: the same
   rounded inputs, pill nila buttons, and cards as the reseller auth
   screens — so a customer account never looks like a bolted-on default.
   Selectors are scoped to .woocommerce so nothing leaks to other pages.
   ============================================================ */

.woocommerce-account .partner-shell .wrap,
.woocommerce-checkout .partner-shell .wrap { padding-block: 28px 56px; }

/* ---------- page + section headings ---------- */
.woocommerce-account h2,
.woocommerce-account .woocommerce > h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--nila);
  margin-bottom: 16px;
}

/* ---------- login / register tabs ----------
   Two tabs — sign in / create account — with one form (a card) shown at a time,
   instead of two stacked forms. Rendered by the form-login.php override. */
.saba-auth-wrap { max-width: 520px; margin-inline: auto; }
.saba-auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--nila-tint);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.saba-auth-tab {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--nila);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background .18s, box-shadow .18s;
}
.saba-auth-tab.is-active {
  background: var(--bg-raised);
  box-shadow: var(--shadow-card);
}
.saba-auth-panel[hidden] { display: none; }
.saba-auth-wrap .saba-login-reseller { margin-top: 18px; }

.woocommerce form.woocommerce-form-login,
.woocommerce form.woocommerce-form-register,
.woocommerce .woocommerce-EditAccountForm,
.woocommerce .woocommerce-address-fields {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-raised);
  padding: 22px 22px 24px;
  box-shadow: var(--shadow-card);
}

/* ---------- fields ---------- */
.woocommerce form .form-row { margin: 0 0 15px; display: block; }
.woocommerce form .form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.woocommerce form .form-row .required { color: var(--clay); border: 0; }

.woocommerce form .input-text,
.woocommerce form input[type="text"],
.woocommerce form input[type="email"],
.woocommerce form input[type="tel"],
.woocommerce form input[type="password"],
.woocommerce form input[type="number"],
.woocommerce form select,
.woocommerce .select2-container .select2-selection {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 14.5px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  line-height: 1.4;
}
.woocommerce form .input-text:focus,
.woocommerce form select:focus {
  outline: none;
  border-color: var(--nila);
}
.woocommerce .select2-container--default .select2-selection--single {
  height: auto;
}
.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.4;
  padding: 0;
  color: var(--ink);
}

/* remember-me + lost password sit on one tidy line */
.woocommerce form.woocommerce-form-login .woocommerce-form-login__rememberme {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft);
}
.woocommerce-LostPassword a { color: var(--nila); font-weight: 700; font-size: 13px; }
.woocommerce form .woocommerce-form-login__submit,
.woocommerce form .woocommerce-form-register__submit { margin-top: 4px; }

/* ---------- buttons (pill, nila) ---------- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-block;
  background: var(--nila);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .18s, transform .12s;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover { background: var(--nila-2); transform: translateY(-1px); }
/* full-width submit inside the auth cards */
.woocommerce form.woocommerce-form-login button.button,
.woocommerce form.woocommerce-form-register button.button { width: 100%; }

/* ---------- logged-in: dashboard nav as pill tabs ----------
   Flex, not grid: the content pane takes flex:1 so it fills the row instead of
   leaving a gap, and WooCommerce's clearfix pseudo-elements collapse to nothing
   here instead of becoming stray cells. */
.woocommerce-account .woocommerce {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}
.woocommerce-account .woocommerce::before,
.woocommerce-account .woocommerce::after { content: none; display: none; }
.woocommerce-MyAccount-navigation { flex: 0 0 210px; }
.woocommerce-MyAccount-content { flex: 1 1 300px; min-width: 0; }
@media (max-width: 760px) {
  .woocommerce-MyAccount-navigation,
  .woocommerce-MyAccount-content { flex-basis: 100%; }
}
/* the login/register screen is one column, not the dashboard flex row */
.woocommerce-account:not(.logged-in) .woocommerce { display: block; }

.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) {
  .woocommerce-MyAccount-navigation ul { flex-direction: row; flex-wrap: wrap; }
}
.woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}
.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation li a:hover {
  background: var(--nila);
  border-color: var(--nila);
  color: #fff;
}

.woocommerce-MyAccount-content {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-raised);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.woocommerce-MyAccount-content p { color: var(--ink-soft); }
.woocommerce-MyAccount-content a { color: var(--nila); font-weight: 700; }

/* ---------- orders table + addresses ---------- */
.woocommerce .woocommerce-orders-table,
.woocommerce table.shop_table {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  width: 100%;
}
.woocommerce table.shop_table th {
  background: var(--nila-tint);
  color: var(--nila);
  font-size: 13px;
  padding: 12px 14px;
  text-align: start;
}
.woocommerce table.shop_table td { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; }

/* One address now (see woocommerce_my_account_get_addresses), full width and
   readable — override WooCommerce's floated 47% columns that squeezed the text
   into one-word-per-line. */
.woocommerce-Addresses.addresses,
.woocommerce-account .woocommerce-Addresses { display: block; }
.woocommerce-Addresses .woocommerce-Address,
.woocommerce-Addresses .u-column1,
.woocommerce-Addresses .u-column2 {
  width: 100% !important;
  float: none !important;
  margin: 0 0 16px !important;
}
.woocommerce-Address address {
  white-space: normal;
  word-break: normal;
  font-style: normal;
  color: var(--ink-soft);
  line-height: 1.9;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  background: var(--bg-raised);
}
.woocommerce-Address-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.woocommerce-Address-title h3 { font-family: var(--font-display); font-size: 17px; color: var(--nila); }

/* ---------- dashboard shortcut cards ---------- */
.saba-account-hello { color: var(--ink-soft); margin-bottom: 16px; font-size: 15px; }
.saba-account-hello strong { color: var(--nila); }
.saba-account-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) { .saba-account-cards { grid-template-columns: 1fr; } }
.saba-account-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-raised);
  padding: 16px 18px;
  transition: border-color .18s, transform .12s, box-shadow .18s;
}
.saba-account-card:hover {
  border-color: var(--nila);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.saba-account-card .ico { font-size: 24px; display: block; margin-bottom: 8px; line-height: 1; }
.saba-account-card .t { display: block; font-weight: 800; color: var(--nila); font-size: 16px; }
.saba-account-card .d { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; font-weight: 400; }
/* the reseller's workspace card stands out */
.saba-account-card--partner { border-color: var(--nila); background: var(--nila-tint); }
.saba-account-card--partner:hover { border-color: var(--nila); }

/* the reseller entry in the account menu, in clay so it reads as "her area" */
.woocommerce-MyAccount-navigation-link--saba_partner a {
  border-color: var(--clay);
  color: var(--clay);
}
.woocommerce-MyAccount-navigation-link--saba_partner a:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}

/* ---------- sign-in intro + reseller line ---------- */
.saba-login-intro { font-size: 15px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }
.saba-login-reseller { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.saba-login-reseller a { color: var(--clay); font-weight: 700; }

/* ---------- notices ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error li,
.woocommerce-error {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  list-style: none;
}
.woocommerce-message { border-inline-start: 4px solid var(--olive); }
.woocommerce-info { border-inline-start: 4px solid var(--nila); }
.woocommerce-error { border-inline-start: 4px solid var(--clay); background: #F7DED8; }
/* WooCommerce draws an icon in a ::before using its own webfont, which the
   theme doesn't load — so it showed as a stray/broken glyph under the "no
   orders yet" line. Drop it; the coloured edge is signal enough. */
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before,
.woocommerce-message::after,
.woocommerce-info::after,
.woocommerce-error::after { content: none !important; display: none !important; }

/* ---------- «طلباتي» as cards ---------- */
/* The five-column table this replaces could not fit a phone; a card holds the
   same facts in two lines and half the height. */
.saba-ord-list { display: flex; flex-direction: column; gap: 10px; }
.saba-ord {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-raised);
  padding: 13px 15px;
  color: inherit;
  font-weight: 400;
  transition: border-color .18s, transform .12s, box-shadow .18s;
}
.saba-ord:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.saba-ord-top,
.saba-ord-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.saba-ord-ref { font-size: 14.5px; color: var(--nila); letter-spacing: .3px; white-space: nowrap; }
.saba-ord-what {
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saba-ord-total { font-size: 14.5px; color: var(--ink); white-space: nowrap; flex: none; }

.saba-ord-pill {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}
.saba-ord-pill--new  { background: #F4EBDA; color: #8C6B18; }
.saba-ord-pill--go   { background: var(--nila-tint); color: var(--nila); }
.saba-ord-pill--done { background: #E7EEDF; color: #4B5E2F; }
.saba-ord-pill--off  { background: #F1EDEA; color: var(--ink-soft); }
/* the left edge repeats the state, so a long list reads as bands of colour */
.saba-ord:has(.saba-ord-pill--new)  { border-inline-start-color: #C9A227; }
.saba-ord:has(.saba-ord-pill--go)   { border-inline-start-color: var(--nila); }
.saba-ord:has(.saba-ord-pill--done) { border-inline-start-color: var(--olive); }

.saba-ord-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.saba-ord-page { font-size: 13px; color: var(--ink-soft); }

.saba-ord-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-raised);
  padding: 30px 22px;
  text-align: center;
}
.saba-ord-empty .ico { font-size: 30px; display: block; margin-bottom: 10px; line-height: 1; }
.saba-ord-empty .t { font-weight: 800; color: var(--nila); font-size: 17px; }
.saba-ord-empty .d { color: var(--ink-soft); font-size: 14px; margin: 6px 0 18px; }

@media (max-width: 420px) {
  .saba-ord-bot { flex-direction: column; align-items: flex-start; gap: 3px; }
  .saba-ord-what { max-width: 100%; }
}
.saba-ord-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.saba-ord-gift {
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: #F8E4DF;
  color: #9A4A33;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* A filled button is not a link: the account pages colour every <a> nila,
   which painted «اتفرجي على المنتجات» in the same navy as its own fill and
   left an empty-looking pill. */
.woocommerce-MyAccount-content a.saba-btn,
.woocommerce-MyAccount-content a.saba-btn:hover,
.woocommerce-MyAccount-content a.saba-btn:focus { color: #fff; }

/* ---------- the account pages on a phone ----------
   Four nested paddings (wrap, the card, the content column, the field box)
   were eating 140px of a 375px screen, so every input sat in a 180px gutter
   and the two half-width rows were 89px wide. On a phone the boxes give up
   their padding and every row is full width. */
@media (max-width: 560px) {
  .woocommerce-account .lp-detail-box { padding-inline: 12px; }
  .woocommerce-MyAccount-content { padding-inline: 0; }
  .woocommerce-MyAccount-content .woocommerce-address-fields__field-wrapper,
  .woocommerce-MyAccount-content fieldset,
  .woocommerce-MyAccount-content .saba-card { padding-inline: 12px; }
  .woocommerce-MyAccount-content .form-row,
  .woocommerce-MyAccount-content .form-row-first,
  .woocommerce-MyAccount-content .form-row-last { width: 100%; float: none; margin-inline: 0; }
  .woocommerce-MyAccount-content input,
  .woocommerce-MyAccount-content select,
  .woocommerce-MyAccount-content textarea { width: 100%; min-height: 48px; font-size: 16px; }
  /* 16px stops iOS zooming the whole page when she taps a field */
}
/* WooCommerce's own `.woocommerce form .form-row-first { width: 47% }` is a
   three-class selector, so the rule above lost to it and the name field
   stayed half-width. Match its weight. */
@media (max-width: 560px) {
  .woocommerce-account .woocommerce form .form-row-first,
  .woocommerce-account .woocommerce form .form-row-last,
  .woocommerce-account .woocommerce form .form-row { width: 100%; float: none; }
}
