/* ============================================================
   ALQUSSADI — My Account Dashboard
   Namespace: alq-ma-* / alq-dash-* / alq-stat-* / alq-order-*
   All design tokens sourced from the theme's :root variables.
   ============================================================ */


/* ── Hide the generic page <h1> on account pages — welcome banner replaces it ── */
.woocommerce-account main.container > .page-header { display: none; }

/* ── Reduce excessive top padding coming from index.php inline style ── */
.woocommerce-account main.container { padding-top: 32px !important; }

/* ── Let WooCommerce wrapper fill the column ── */
.woocommerce-account .woocommerce { width: 100%; }


/* ================================================================
   PAGE LAYOUT: two-column sidebar + content
   In RTL the 260 px column appears on the right (start side).
   ================================================================ */

.alq-ma-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.alq-ma-sidebar {
  position: sticky;
  top: 108px; /* just below sticky header (~84px) + nav (~56px) */
  min-width: 0; /* grid children default to min-width:auto — enforce track boundary */
}

/* Both grid children must declare min-width:0 or content drives column width */
.alq-ma-content {
  min-width: 0;
  max-width: 100%;
}


/* ================================================================
   SIDEBAR CARD
   ================================================================ */

.alq-ma-nav-inner {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

/* ── User mini-card (dark header) ── */
.alq-ma-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.alq-ma-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue-600);
  border: 2px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.alq-ma-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.alq-ma-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.alq-ma-user-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-400);
}


/* ── Navigation list ── */
.alq-ma-sidebar .woocommerce-MyAccount-navigation { padding: 8px; }

.alq-ma-sidebar .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alq-ma-sidebar .woocommerce-MyAccount-navigation li { display: block; }

.alq-ma-sidebar .woocommerce-MyAccount-navigation li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  line-height: 1;
}

.alq-ma-sidebar .woocommerce-MyAccount-navigation li a:hover {
  background: var(--blue-50);
  color: var(--navy-800);
}

/* Active link */
.alq-ma-sidebar .woocommerce-MyAccount-navigation li.is-active > a {
  background: var(--blue-50);
  color: var(--navy-800);
  font-weight: 700;
}

.alq-ma-sidebar .woocommerce-MyAccount-navigation li.is-active .alq-ma-nav-icon {
  color: var(--blue-600);
}

/* Logout item */
.alq-ma-sidebar .woocommerce-MyAccount-navigation-link--customer-logout > a {
  color: var(--coral-600) !important;
}

.alq-ma-sidebar .woocommerce-MyAccount-navigation-link--customer-logout > a:hover {
  background: var(--coral-100) !important;
  color: var(--coral-600) !important;
}

.alq-ma-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink-400);
  transition: color 0.14s;
}

.alq-ma-sidebar .woocommerce-MyAccount-navigation li a:hover .alq-ma-nav-icon {
  color: var(--blue-600);
}

.alq-ma-nav-label { flex: 1; }


/* ================================================================
   LOGIN / REGISTER WRAP (non-logged-in state)
   ================================================================ */

.alq-ma-login-wrap { max-width: 860px; margin: 0 auto; }

/* WooCommerce two-col login form */
.alq-ma-login-wrap .u-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.alq-ma-login-wrap .woocommerce-form {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--sh-1);
}

.alq-ma-login-wrap h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-900);
  margin: 0 0 20px;
}

.alq-ma-login-wrap .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.alq-ma-login-wrap .form-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-800);
}

.alq-ma-login-wrap .form-row input[type="text"],
.alq-ma-login-wrap .form-row input[type="email"],
.alq-ma-login-wrap .form-row input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--f-ar);
  font-size: 14px;
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.alq-ma-login-wrap .form-row input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(58,107,219,0.1);
}

.alq-ma-login-wrap .woocommerce-form__label-for-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
  margin-bottom: 16px;
}

.alq-ma-login-wrap .woocommerce-Button,
.alq-ma-login-wrap .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-ar);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s;
}

.alq-ma-login-wrap .woocommerce-Button:hover,
.alq-ma-login-wrap .button:hover { background: var(--blue-600); }

.alq-ma-login-wrap .lost_password { margin-top: 12px; }

.alq-ma-login-wrap .lost_password a {
  font-size: 13px;
  color: var(--blue-600);
}


/* ================================================================
   DASHBOARD
   ================================================================ */

.alq-dashboard {
  display: flex;
  flex-direction: column;
  gap: 22px;
}


/* ── Welcome banner ── */
.alq-dash-welcome {
  background: var(--navy-900);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* Subtle dot grid texture — matches homepage hero */
.alq-dash-welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(110,160,232,0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.alq-dash-welcome-text {
  position: relative;
  z-index: 1;
}

.alq-dash-welcome-text h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.3;
}

.alq-dash-welcome-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin: 0;
  line-height: 1.5;
}

.alq-dash-shop-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--coral-500);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.14s, transform 0.14s;
}

.alq-dash-shop-btn:hover {
  background: var(--coral-600);
  transform: translateY(-1px);
}


/* ── Stats grid ── */
.alq-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.alq-stat-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--sh-1);
  min-width: 0; /* grid child — must not expand beyond its track */
}

.alq-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.alq-stat-icon--orders    { background: var(--blue-50);  color: var(--blue-600); }
.alq-stat-icon--completed { background: var(--green-100); color: var(--green-500); }
.alq-stat-icon--address   { background: var(--blue-50);  color: var(--navy-800); }
.alq-stat-icon--account   { background: var(--blue-50);  color: var(--navy-800); }

.alq-stat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.alq-stat-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--f-en);
  color: var(--navy-900);
  line-height: 1;
}

.alq-stat-label {
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alq-stat-action-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1;
}

.alq-stat-action-link:hover { color: var(--blue-600); }


/* ── Section card ── */
.alq-dash-section {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.alq-dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.alq-dash-section-head h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-900);
  margin: 0;
}

.alq-dash-see-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-600);
}

.alq-dash-see-all:hover { color: var(--navy-800); }


/* ── Orders preview list ── */
.alq-orders-list { padding: 4px 0; }

.alq-order-row {
  display: grid;
  grid-template-columns: 130px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.alq-order-row:last-child { border-bottom: none; }
.alq-order-row:hover { background: var(--bg-soft); }

.alq-order-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.alq-order-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
  font-family: var(--f-en);
  direction: ltr;
  display: inline-block;
}

.alq-order-date {
  font-size: 11px;
  color: var(--ink-400);
  white-space: nowrap;
}

.alq-order-items-text {
  font-size: 13px;
  color: var(--ink-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alq-order-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.alq-order-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
  font-family: var(--f-en);
  direction: ltr;
  display: inline-block;
  white-space: nowrap;
}

.alq-order-view-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--bg);
  white-space: nowrap;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}

.alq-order-view-btn:hover {
  border-color: var(--blue-400);
  color: var(--blue-600);
  background: var(--blue-50);
}


/* ── Status badges ── */
.alq-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.5;
}

.alq-badge--pending    { background: #FEF3C7; color: #92400E; }
.alq-badge--processing { background: var(--blue-50);  color: var(--blue-600); }
.alq-badge--hold       { background: #F3F4F6; color: var(--ink-700); }
.alq-badge--completed  { background: var(--green-100); color: var(--green-500); }
.alq-badge--cancelled  { background: #FEE2E2; color: #DC2626; }
.alq-badge--refunded   { background: #F3E8FF; color: #7C3AED; }
.alq-badge--failed     { background: #FEE2E2; color: #DC2626; }
.alq-badge--default    { background: var(--bg-soft); color: var(--ink-700); }


/* ── Empty state ── */
.alq-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.alq-empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--ink-300);
}

.alq-empty-state p {
  font-size: 14px;
  color: var(--ink-500);
  margin: 0;
}

.alq-empty-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.14s;
}

.alq-empty-cta:hover { background: var(--blue-600); }


/* ── Quick shortcuts grid ── */
.alq-dash-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.alq-shortcut-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  text-align: center;
  box-shadow: var(--sh-1);
  min-width: 0; /* grid child — must not expand beyond its track */
  transition: border-color 0.14s, background 0.14s, transform 0.14s, box-shadow 0.14s;
}

.alq-shortcut-card:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  color: var(--navy-800);
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
}

.alq-shortcut-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--blue-50);
  color: var(--navy-800);
  display: grid;
  place-items: center;
  transition: background 0.14s, color 0.14s;
}

.alq-shortcut-card:hover .alq-shortcut-icon {
  background: var(--navy-900);
  color: #fff;
}


/* ================================================================
   INNER CONTENT PAGES
   Orders list, address, edit account, payment methods, etc.
   Scoped inside .alq-ma-content to avoid global leaks.
   ================================================================ */

/* ── Section title ── */
.alq-ma-content h2 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 18px;
}

/* ── Generic WC notices ── */
.alq-ma-content .woocommerce-message,
.alq-ma-content .woocommerce-error,
.alq-ma-content .woocommerce-info {
  border-radius: var(--r-lg);
  padding: 13px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
}

/* ── Orders & data tables ── */
.alq-ma-content table.shop_table,
.alq-ma-content table.woocommerce-orders-table {
  width: 100%;
  max-width: 100%; /* critical: display:block tables measure content width, not parent width */
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--sh-1);
}

.alq-ma-content table.shop_table thead,
.alq-ma-content table.woocommerce-orders-table thead {
  background: var(--bg-soft);
}

.alq-ma-content table.shop_table th,
.alq-ma-content table.woocommerce-orders-table th {
  padding: 13px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
  text-align: right;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}

.alq-ma-content table.shop_table td,
.alq-ma-content table.woocommerce-orders-table td {
  padding: 15px 20px;
  font-size: 14px;
  color: var(--ink-700);
  text-align: right;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.alq-ma-content table.shop_table tbody tr:last-child td,
.alq-ma-content table.woocommerce-orders-table tbody tr:last-child td {
  border-bottom: none;
}

.alq-ma-content table.shop_table tbody tr:hover,
.alq-ma-content table.woocommerce-orders-table tbody tr:hover {
  background: var(--bg-soft);
}

/* Order status marks inside table */
.alq-ma-content table .order-status,
.alq-ma-content table .woocommerce-orders-table__cell-order-status mark {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--ink-700);
}

/* Reuse status colors via WC's own order status classes */
.alq-ma-content .status-completed mark { background: var(--green-100); color: var(--green-500); }
.alq-ma-content .status-processing mark { background: var(--blue-50); color: var(--blue-600); }
.alq-ma-content .status-on-hold mark { background: #FEF3C7; color: #92400E; }
.alq-ma-content .status-cancelled mark { background: #FEE2E2; color: #DC2626; }

/* Table buttons */
.alq-ma-content table .woocommerce-button,
.alq-ma-content table .button,
.alq-ma-content table a.button {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--bg);
  text-decoration: none;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}

.alq-ma-content table .woocommerce-button:hover,
.alq-ma-content table .button:hover,
.alq-ma-content table a.button:hover {
  border-color: var(--blue-400);
  color: var(--blue-600);
  background: var(--blue-50);
}


/* ── Address page ── */
.alq-ma-content .woocommerce-Addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.alq-ma-content .woocommerce-Address {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--sh-1);
}

.alq-ma-content .woocommerce-Address-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.alq-ma-content .woocommerce-Address-title h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-900);
  margin: 0;
}

.alq-ma-content .woocommerce-Address-title .edit {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-600);
  text-decoration: none;
}

.alq-ma-content .woocommerce-Address-title .edit:hover { color: var(--navy-800); }

.alq-ma-content address {
  font-style: normal;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-700);
}

.alq-ma-content .woocommerce-Address p {
  font-size: 13px;
  color: var(--ink-400);
  margin: 0;
  line-height: 1.5;
}


/* ── Edit Account & Edit Address forms ── */
.alq-ma-content .woocommerce-EditAccountForm,
.alq-ma-content .woocommerce-address-fields,
.alq-ma-content form.edit-account {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--sh-1);
}

.alq-ma-content .form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.alq-ma-content .form-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: 0.02em;
}

.alq-ma-content .form-row .required { color: var(--coral-500); }

.alq-ma-content .form-row input[type="text"],
.alq-ma-content .form-row input[type="email"],
.alq-ma-content .form-row input[type="password"],
.alq-ma-content .form-row input[type="tel"],
.alq-ma-content .form-row select,
.alq-ma-content .form-row textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--f-ar);
  font-size: 14px;
  color: var(--ink-900);
  background: var(--bg);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  direction: rtl;
}

.alq-ma-content .form-row input:focus,
.alq-ma-content .form-row select:focus,
.alq-ma-content .form-row textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(58,107,219,0.1);
}

.alq-ma-content .form-row.woocommerce-invalid input,
.alq-ma-content .form-row.woocommerce-invalid select {
  border-color: var(--coral-500);
}

/* Two-column field pairs */
.alq-ma-content .form-row-first,
.alq-ma-content .form-row-last {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  width: calc(50% - 10px);
  margin-bottom: 16px;
  vertical-align: top;
}

/* RTL: first = right, last = left */
.alq-ma-content .form-row-first { margin-left: 20px; }

/* Submit button */
.alq-ma-content .woocommerce-EditAccountForm .woocommerce-Button,
.alq-ma-content [name="save_account_details"],
.alq-ma-content [name="save_address"] {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-ar);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s;
  margin-top: 6px;
}

.alq-ma-content .woocommerce-EditAccountForm .woocommerce-Button:hover,
.alq-ma-content [name="save_account_details"]:hover,
.alq-ma-content [name="save_address"]:hover { background: var(--blue-600); }

/* Password change fieldset */
.alq-ma-content fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin: 16px 0;
}

.alq-ma-content fieldset legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-800);
  padding: 0 8px;
}


/* ── Payment Methods ── */
.alq-ma-content .woocommerce-MyAccount-paymentMethods {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-1);
}

.alq-ma-content .woocommerce-MyAccount-paymentMethods th {
  background: var(--bg-soft);
  padding: 13px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
  text-align: right;
  letter-spacing: 0.04em;
}

.alq-ma-content .woocommerce-MyAccount-paymentMethods td {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--ink-700);
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.alq-ma-content .button.delete { color: var(--coral-600) !important; border-color: var(--coral-100) !important; }
.alq-ma-content .button.delete:hover { background: var(--coral-100) !important; }


/* ── Generic .button throughout content ── */
.alq-ma-content .button,
.alq-ma-content a.button {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-ar);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s;
}

.alq-ma-content .button:hover,
.alq-ma-content a.button:hover { background: var(--blue-600); }

/* Alt button (View Order etc.) — WC uses .woocommerce-button.button.view */
.alq-ma-content a.button.view,
.alq-ma-content a.button.pay,
.alq-ma-content a.button.cancel {
  background: var(--bg);
  color: var(--ink-700);
  border: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 12px;
}

.alq-ma-content a.button.view:hover,
.alq-ma-content a.button.pay:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.alq-ma-content a.button.cancel:hover {
  background: var(--coral-100);
  border-color: var(--coral-500);
  color: var(--coral-600);
}

/* Order-detail page */
.alq-ma-content .woocommerce-order-details,
.alq-ma-content .woocommerce-customer-details {
  margin-bottom: 28px;
}

.alq-ma-content .woocommerce-order-details__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-900);
  margin: 0 0 14px;
}


/* ================================================================
   OVERFLOW CONTAINMENT — global rules
   These apply at all breakpoints and are the primary defence
   against any element escaping the viewport width.
   ================================================================ */

/* Flex / grid children: browser default is min-width:auto which lets
   a child grow past its allocated track. Explicit 0 enforces the track. */
.alq-dashboard > * {
  min-width: 0;
  max-width: 100%;
}

/* Long unbreakable strings (emails, URLs, Arabic text) */
.alq-ma-content p,
.alq-ma-content address,
.alq-ma-content td,
.alq-ma-content th,
.alq-ma-content li,
.alq-stat-label,
.alq-order-items-text {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Media: never wider than their container */
.alq-ma-content img,
.alq-ma-content video,
.alq-ma-content iframe,
.alq-ma-content embed {
  max-width: 100%;
  height: auto;
}

/* WooCommerce address, form, and payment blocks */
.alq-ma-content .woocommerce-Address,
.alq-ma-content .woocommerce-EditAccountForm,
.alq-ma-content .woocommerce-address-fields,
.alq-ma-content form.edit-account,
.alq-ma-content .woocommerce-MyAccount-paymentMethods {
  max-width: 100%;
  box-sizing: border-box;
}

/* All inputs/selects: respect column width regardless of browser default */
.alq-ma-content input,
.alq-ma-content select,
.alq-ma-content textarea {
  max-width: 100%;
  box-sizing: border-box;
}


/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ── Tablet: 768px – 1023px ── */
@media (max-width: 1023px) {

  .alq-ma-layout {
    grid-template-columns: 210px 1fr;
    gap: 18px;
  }

  .alq-dash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .alq-dash-shortcuts {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .alq-dash-section-head { padding: 16px 20px; }

  .alq-order-row {
    grid-template-columns: 120px 1fr auto auto;
    gap: 12px;
    padding: 12px 20px;
  }

}

/* ── Mobile: ≤767px ── */
@media (max-width: 767px) {

  /* ── Hard containment clip ──────────────────────────────────────
     position:sticky is disabled on mobile (sidebar is static), so
     overflow-x:hidden here is safe and provides the final hard stop
     for any element that escapes its column.
  ──────────────────────────────────────────────────────────────── */
  .alq-ma-wrap { overflow-x: hidden; }

  /* Force every major structural block to respect viewport width */
  .alq-ma-sidebar,
  .alq-ma-content,
  .alq-ma-nav-inner,
  .alq-dashboard,
  .alq-dashboard > *,
  .alq-dash-section,
  .alq-dash-welcome,
  .alq-dash-stats,
  .alq-dash-shortcuts,
  .alq-stat-card,
  .alq-shortcut-card,
  .alq-orders-list {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Nav scroll container: explicit 100% so overflow-x:auto has a
     defined width to measure against (prevents list from pulling
     the container wider than the viewport) */
  .alq-ma-sidebar .woocommerce-MyAccount-navigation { max-width: 100%; }
  .alq-ma-sidebar .woocommerce-MyAccount-navigation ul {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Tables: display:block needs an explicit max-width since the
     browser measures table width from cell content, not parent */
  .alq-ma-content table.shop_table,
  .alq-ma-content table.woocommerce-orders-table {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* All form controls: bounded to their column */
  .alq-ma-content input,
  .alq-ma-content select,
  .alq-ma-content textarea {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* WC-generated content wrappers */
  .alq-ma-content .woocommerce-Address,
  .alq-ma-content .woocommerce-Addresses,
  .alq-ma-content .woocommerce-EditAccountForm,
  .alq-ma-content .woocommerce-address-fields,
  .alq-ma-content form.edit-account,
  .alq-ma-content .woocommerce-MyAccount-paymentMethods {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Tighten page chrome */
  .woocommerce-account main.container {
    padding-top: 16px !important;
    padding-bottom: 48px !important;
  }

  /* ── Layout: sidebar stacks above content ── */
  .alq-ma-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .alq-ma-sidebar { position: static; top: auto; }

  /* ── Sidebar user card: compact ── */
  .alq-ma-user {
    padding: 12px 14px;
    gap: 10px;
  }

  .alq-ma-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .alq-ma-user-name { font-size: 13px; }
  .alq-ma-user-role { font-size: 10px; }

  /* ── Nav: horizontal scroll pill row ── */
  .alq-ma-sidebar .woocommerce-MyAccount-navigation { padding: 6px; }

  .alq-ma-sidebar .woocommerce-MyAccount-navigation ul {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0;
  }

  .alq-ma-sidebar .woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }

  .alq-ma-sidebar .woocommerce-MyAccount-navigation li a {
    white-space: nowrap;
    padding: 7px 11px;
    font-size: 12px;
    gap: 5px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
  }

  .alq-ma-sidebar .woocommerce-MyAccount-navigation li.is-active > a {
    background: var(--blue-50);
    border-color: var(--blue-400);
    color: var(--navy-800);
  }

  /* Hide icon text on very small screens for pills */
  .alq-ma-sidebar .woocommerce-MyAccount-navigation .alq-ma-nav-icon {
    width: 14px;
    height: 14px;
  }

  .alq-ma-sidebar .woocommerce-MyAccount-navigation .alq-ma-nav-icon svg {
    width: 14px;
    height: 14px;
  }

  /* ── Dashboard flow: tighter gap ── */
  .alq-dashboard { gap: 14px; }

  /* ── Welcome banner ── */
  .alq-dash-welcome {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 18px 16px;
    gap: 14px;
  }

  .alq-dash-welcome-text h2 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .alq-dash-welcome-text p { font-size: 12px; }

  .alq-dash-shop-btn {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
    font-size: 13px;
  }

  /* ── Stats grid ── */
  .alq-dash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .alq-stat-card {
    padding: 12px;
    gap: 10px;
  }

  .alq-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
  }

  .alq-stat-icon svg { width: 16px; height: 16px; }

  .alq-stat-value { font-size: 18px; }

  .alq-stat-label { font-size: 11px; }

  .alq-stat-action-link { font-size: 12px; }

  /* ── Section card head ── */
  .alq-dash-section-head {
    padding: 12px 16px;
  }

  .alq-dash-section-head h3 { font-size: 14px; }

  .alq-dash-see-all { font-size: 11px; }

  /* ── Orders preview rows ── */
  .alq-orders-list { padding: 2px 0; }

  .alq-order-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    align-items: flex-start;
  }

  .alq-order-id {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .alq-order-num { font-size: 13px; }
  .alq-order-date { font-size: 11px; }

  .alq-order-items-text {
    font-size: 12px;
    white-space: normal;
    line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }

  .alq-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .alq-order-view-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
  }

  /* ── Empty state ── */
  .alq-empty-state {
    padding: 32px 16px;
    gap: 10px;
  }

  .alq-empty-icon { width: 56px; height: 56px; }
  .alq-empty-icon svg { width: 28px; height: 28px; }
  .alq-empty-state p { font-size: 13px; }

  /* ── Shortcuts grid ── */
  .alq-dash-shortcuts {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .alq-shortcut-card {
    padding: 14px 10px;
    gap: 8px;
    font-size: 12px;
    border-radius: var(--r-md);
  }

  .alq-shortcut-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
  }

  .alq-shortcut-icon svg { width: 16px; height: 16px; }

  /* ── Inner content pages ── */

  /* Section heading */
  .alq-ma-content h2 { font-size: 16px; margin-bottom: 14px; }

  /* Tables: horizontal scroll */
  .alq-ma-content table.shop_table,
  .alq-ma-content table.woocommerce-orders-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .alq-ma-content table.shop_table th,
  .alq-ma-content table.woocommerce-orders-table th {
    padding: 10px 14px;
    white-space: nowrap;
  }

  .alq-ma-content table.shop_table td,
  .alq-ma-content table.woocommerce-orders-table td {
    padding: 11px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Address cards: single column */
  .alq-ma-content .woocommerce-Addresses { grid-template-columns: 1fr; }

  .alq-ma-content .woocommerce-Address { padding: 16px; }

  /* Forms: reduce padding */
  .alq-ma-content .woocommerce-EditAccountForm,
  .alq-ma-content .woocommerce-address-fields,
  .alq-ma-content form.edit-account {
    padding: 18px;
  }

  /* Form half-rows → full width */
  .alq-ma-content .form-row-first,
  .alq-ma-content .form-row-last {
    width: 100%;
    margin-left: 0;
    display: flex;
  }

  .alq-ma-content .form-row input,
  .alq-ma-content .form-row select,
  .alq-ma-content .form-row textarea {
    font-size: 13px;
    padding: 10px 12px;
  }

  /* Submit buttons full width on mobile */
  .alq-ma-content .woocommerce-EditAccountForm .woocommerce-Button,
  .alq-ma-content [name="save_account_details"],
  .alq-ma-content [name="save_address"] {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
  }

  /* Login/register: single column */
  .alq-ma-login-wrap .u-columns { grid-template-columns: 1fr; }

  .alq-ma-login-wrap .woocommerce-form { padding: 20px; }

  .alq-ma-login-wrap .woocommerce-Button,
  .alq-ma-login-wrap .button {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
  }

}

/* ── Small phones: ≤400px ── */
@media (max-width: 400px) {

  /* Reduce side padding on narrow screens; !important overrides
     the inline style="padding:64px 28px" set in index.php */
  .woocommerce-account main.container {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }

  /* Ensure the wrap hard-clips at the new narrower padding boundary */
  .alq-ma-wrap { overflow-x: hidden; }

  .alq-dash-welcome { padding: 14px; }

  .alq-dash-welcome-text h2 { font-size: 16px; }

  .alq-stat-card { padding: 10px; gap: 8px; }
  .alq-stat-value { font-size: 17px; }

  .alq-shortcut-card { padding: 12px 8px; font-size: 11px; }

  /* Nav pills: hide icon label text, show icon only on 360px phones */
  .alq-ma-sidebar .woocommerce-MyAccount-navigation .alq-ma-nav-label {
    display: none;
  }

  .alq-ma-sidebar .woocommerce-MyAccount-navigation li a {
    padding: 8px 10px;
    justify-content: center;
  }

}
