/* ==========================================================================
   My Account / WooCommerce account pages — themed, RTL (sidebar + content).
   Uses the theme palette (--primary etc.); account is never category-tinted.
   ========================================================================== */

.gz-account {
  direction: rtl;
  text-align: right;
  background: #f6f8fc;
  padding: 32px 0 64px;
}

.gz-account__container {
  width: 1200px;
  max-width: calc(100% - 32px);
  margin: 0 auto;
}

.gz-account__head { margin-bottom: 20px; }

.gz-account__title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark, #002363);
}

.gz-account__crumb { margin: 0; color: #8a93a6; font-size: 14px; }
.gz-account__crumb a { color: var(--primary, #002f87); text-decoration: none; }
.gz-account__crumb span { margin: 0 6px; }

/* ---- Layout: sidebar (right) + content (left) ---- */
.gz-account__layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 24px;
  align-items: start;
}

/* WC core sets .woocommerce-MyAccount-navigation{float:left;width:30%} and
   -content{width:68%}; inside our grid that shrinks them to 30%/68% of the cell.
   Force them to fill their grid cells. */
.gz-account__layout > .gz-account__nav,
.gz-account__layout > .gz-account__content {
  float: none !important;
  width: auto !important;
}

/* ---- Sidebar ---- */
.gz-account__nav {
  background: #fff;
  border: 1px solid #e7ecf5;
  border-radius: 16px;
  padding: 20px 14px;
  position: sticky;
  top: 16px;
}

.gz-account__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid #eef1f7;
}

.gz-account__avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary, #002f87);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.gz-account__user-meta { display: flex; flex-direction: column; min-width: 0; }
.gz-account__hello { font-size: 12px; color: #8a93a6; }
.gz-account__user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark, #002363);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gz-account__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.gz-account__nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #3d4658;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.gz-account__nav-icon { display: inline-flex; color: #8a93a6; transition: color .15s; }
.gz-account__nav li a:hover { background: #f1f5fd; color: var(--primary, #002f87); }
.gz-account__nav li a:hover .gz-account__nav-icon { color: var(--primary, #002f87); }

.gz-account__nav li.is-active a,
.gz-account__nav li.woocommerce-MyAccount-navigation-link--active a {
  background: var(--primary, #002f87);
  color: #fff;
}
.gz-account__nav li.is-active a .gz-account__nav-icon,
.gz-account__nav li.woocommerce-MyAccount-navigation-link--active a .gz-account__nav-icon { color: #fff; }

.gz-account__nav li.woocommerce-MyAccount-navigation-link--customer-logout a { color: #c0392b; }
.gz-account__nav li.woocommerce-MyAccount-navigation-link--customer-logout a:hover { background: #fdecec; }

/* ---- Content card ---- */
.gz-account__content {
  background: #fff;
  border: 1px solid #e7ecf5;
  border-radius: 16px;
  padding: 28px;
  min-height: 360px;
  color: #2c3441;
}

.gz-account__content a { color: var(--primary, #002f87); }

/* ---- Dashboard ---- */
.gz-dash__hello { margin: 0 0 6px; font-size: 18px; color: var(--primary-dark, #002363); }
.gz-dash__logout { font-size: 14px; font-weight: 600; }
.gz-dash__intro { margin: 0 0 24px; color: #5a6473; line-height: 1.9; }

.gz-dash__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.gz-dash__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px solid #e7ecf5;
  border-radius: 14px;
  background: #fafbff;
  text-decoration: none !important;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.gz-dash__card:hover { border-color: var(--primary, #002f87); box-shadow: 0 8px 24px rgba(0,47,135,.08); transform: translateY(-2px); }
.gz-dash__card-title { font-size: 17px; font-weight: 700; color: var(--primary-dark, #002363); }
.gz-dash__card-desc { font-size: 13px; color: #6b7384; }
.gz-dash__card-arrow { position: absolute; bottom: 16px; left: 18px; color: var(--primary, #002f87); font-size: 18px; }

/* ---- WooCommerce tables (orders, downloads, order details) ---- */
.gz-account__content table.woocommerce-table,
.gz-account__content table.woocommerce-orders-table,
.gz-account__content table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 14px;
  border: 1px solid #eef1f7;
  border-radius: 12px;
  overflow: hidden;
}

.gz-account__content table th,
.gz-account__content table td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid #eef1f7;
}

.gz-account__content table thead th {
  background: #f3f6fc;
  color: var(--primary-dark, #002363);
  font-weight: 700;
  font-size: 13px;
}

.gz-account__content table tbody tr:last-child td { border-bottom: 0; }
.gz-account__content table tbody tr:hover { background: #fafbff; }

/* ---- Addresses ---- */
.woocommerce-Addresses,
.gz-account__content .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}
/* WC core gives .col-1/.col-2 float + width:48% → inside our grid that becomes
   48% of the cell. Force them to fill the grid cell instead. */
.gz-account__content .woocommerce-Addresses > *,
.gz-account__content .woocommerce-Address {
  float: none !important;
  width: auto !important;
}
.woocommerce-Address {
  border: 1px solid #e7ecf5;
  border-radius: 14px;
  padding: 20px;
  background: #fafbff;
}
.woocommerce-Address address { display: block; width: 100%; }
.woocommerce-Address-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.woocommerce-Address-title h2, .woocommerce-Address-title h3 { margin: 0; font-size: 17px; color: var(--primary-dark, #002363); }
.woocommerce-Address address { font-style: normal; line-height: 1.9; color: #5a6473; }
.woocommerce-Address .edit { font-weight: 700; font-size: 14px; }

/* ---- Forms (edit account / edit address / login / register) ---- */
.gz-account__content .woocommerce-form-row,
.gz-account__content .form-row,
.woocommerce-account .woocommerce-form-row {
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
}

.gz-account__content label,
.woocommerce-account form label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #3d4658;
}

.gz-account__content input[type="text"],
.gz-account__content input[type="email"],
.gz-account__content input[type="password"],
.gz-account__content input[type="tel"],
.gz-account__content select,
.gz-account__content textarea,
.woocommerce-account .woocommerce input.input-text,
.woocommerce-account .woocommerce select,
.woocommerce-account .woocommerce textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #d9e0ec;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: #2c3441;
  direction: rtl;
  text-align: right;
}
.gz-account__content input:focus,
.gz-account__content select:focus,
.gz-account__content textarea:focus,
.woocommerce-account .woocommerce input.input-text:focus {
  outline: none;
  border-color: var(--primary, #002f87);
  box-shadow: 0 0 0 3px rgba(0,47,135,.12);
}

.woocommerce-form-login__rememberme,
.woocommerce-form__label-for-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}
.woocommerce-form__input-checkbox { width: auto !important; }

/* ---- Buttons ---- */
.woocommerce-account .woocommerce .button,
.gz-account__content .button,
.gz-account__content button[type="submit"],
.woocommerce-account .woocommerce button.button,
.woocommerce-Button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border: 1.5px solid var(--primary, #002f87);
  border-radius: 999px;
  background: var(--primary, #002f87);
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.woocommerce-account .woocommerce .button:hover,
.gz-account__content button[type="submit"]:hover { background: var(--primary-dark, #002363); border-color: var(--primary-dark, #002363); }

.woocommerce-account .woocommerce a.button.view,
.woocommerce-account .woocommerce .button.pay { padding: 8px 18px; font-size: 13px; }

/* ---- Notices ---- */
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-error {
  list-style: none;
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 12px;
  border-right: 4px solid var(--primary, #002f87);
  background: #eef3fc;
  color: #2c3441;
  font-size: 14px;
}
.woocommerce-account .woocommerce-error { border-right-color: #c0392b; background: #fdecec; }
.woocommerce-account .woocommerce-message { border-right-color: #1f9d55; background: #ecf8f1; }

/* ---- Login / Register two-column ---- */
.woocommerce-account #customer_login.u-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.woocommerce-account #customer_login .u-column1,
.woocommerce-account #customer_login .u-column2 {
  background: #fff;
  border: 1px solid #e7ecf5;
  border-radius: 16px;
  padding: 28px;
}
.woocommerce-account #customer_login h2 {
  margin: 0 0 18px;
  font-size: 20px;
  color: var(--primary-dark, #002363);
}

/* The bare login page (no .gz-account wrapper) gets centered spacing + RTL.
   Scoped with :has so it never constrains the logged-in account layout. */
.woocommerce-account .woocommerce { direction: rtl; text-align: right; }
.woocommerce-account .woocommerce:has(#customer_login),
.woocommerce-account .woocommerce:has(.woocommerce-form-login),
.woocommerce-account .woocommerce:has(.woocommerce-ResetPassword),
.woocommerce-account .woocommerce:has(.woocommerce-LostPassword) {
  width: 1100px;
  max-width: calc(100% - 32px);
  margin: 32px auto 64px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .gz-account__layout {
    grid-template-columns: 1fr;
  }
  .gz-account__nav {
    position: static;
    padding: 16px;
  }
  /* المستخدم — على اليمين */
  .gz-account__user {
    justify-content: flex-end;
    text-align: right;
    flex-direction: row-reverse;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  /* القائمة — grid عمودين، عناصر أفقية */
  .gz-account__nav ul {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    direction: rtl !important;
  }
  .gz-account__nav li a {
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 12px 14px !important;
    direction: ltr !important;
  }
  .gz-account__nav-icon {
    order: unset !important;
  }
  .gz-account__nav-label {
    order: unset !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  .gz-dash__cards { grid-template-columns: 1fr; }
  .woocommerce-Addresses,
  .gz-account__content .woocommerce-Addresses { grid-template-columns: 1fr; }
  .woocommerce-account #customer_login.u-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .gz-account__content { padding: 18px; }
  .gz-account__nav-label { font-size: 13px; }
}

/* ===== Account page fixes (#2 order "view" button, #5 address title) ===== */

/* #2 — styled "عرض" button in the orders table */
.woocommerce-orders-table__cell-order-actions .button,
.woocommerce-button.button.view {
  background: #002f87 !important;
  color: white !important;
  border-radius: 99px !important;
  padding: 8px 24px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border: none !important;
  text-decoration: none !important;
}

/* #5 — billing/address section titles */
.woocommerce-address-fields h3,
.woocommerce-Address-title h3 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #002363 !important;
  margin-bottom: 16px !important;
}

/* ===== MY WARRANTIES PAGE (mapped to real plugin classes .grz-w-*) ===== */
.grz-w-wrap {
  max-width: 100%;
  margin: 40px auto;
  padding: 0 24px;
  direction: rtl;
}

/* العنوان + زرار إضافة */
.grz-w-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.grz-w-title {
  font-size: 24px;
  font-weight: 700;
  color: #002363;
  margin: 0;
}
.grz-w-add {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px;
  background: #002f87 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 99px !important;
  padding: 10px 24px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  margin-bottom: 16px !important;
  float: left !important;
}

/* رسالة فارغ (woocommerce-info داخل صفحة الضمانات فقط) */
.grz-w-wrap .woocommerce-info {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border: none;
  margin-bottom: 24px;
}
.grz-w-wrap .woocommerce-info::before { display: none; }

/* زرار مزامنة */
.grz-w-wrap form .button,
.grz-w-wrap .button.button-primary {
  display: block;
  width: fit-content;
  margin: 16px auto 8px;
  background: #002f87;
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

/* تلميح المزامنة */
.grz-w-wrap form p {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-top: 8px;
}
