/* ============================================================
   MY ACCOUNT — Custom Styles
   Uses theme CSS variables from :root in app-theme.scss
   ============================================================ */

/* ── Page Shell ─────────────────────────────────────────── */
.myaccount-page {
  background-color: var(--primary-light);
  min-height: 60vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.myaccount-sidebar {
  position: sticky;
  top: 100px;
}

.myaccount-user-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.myaccount-user-card .user-avatar img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 2px solid var(--light-silver);
}

.myaccount-user-card .user-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-dark);
  margin: 0 0 2px;
  font-family: var(--family-urbanist-sans);
}

.myaccount-user-card .user-email {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  word-break: break-all;
}

.myaccount-nav {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.myaccount-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  color: var(--text-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  font-family: var(--family-urbanist-sans);
}

.myaccount-nav-link:not(:last-child) {
  border-bottom: 1px solid var(--light-silver);
}

.myaccount-nav-link svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.myaccount-nav-link:hover {
  background-color: var(--primary-light);
  color: var(--text-dark);
  border-left-color: var(--theme-secondary);
}

.myaccount-nav-link:hover svg {
  opacity: 1;
}

.myaccount-nav-link.active {
  background-color: var(--primary-light);
  border-left-color: var(--theme-secondary);
  font-weight: 700;
  color: var(--black);
}

.myaccount-nav-link.active svg {
  opacity: 1;
}

.myaccount-nav-link.logout-link {
  color: var(--sale-red);
}

.myaccount-nav-link.logout-link:hover {
  background-color: var(--discount-bg);
  border-left-color: var(--sale-red);
  color: var(--sale-red);
}

/* ── Content Card ────────────────────────────────────────── */
.myaccount-content-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 2rem;
}

/* ── Section Headings ────────────────────────────────────── */
.section-heading-row {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--light-silver);
}

.section-heading {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  font-family: var(--family-urbanist-sans);
}

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--light-silver);
}

.dashboard-greeting {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 0.25rem;
  font-family: var(--family-urbanist-sans);
}

.dashboard-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.dashboard-stats {
  margin-bottom: 2rem;
}

.stat-box {
  background: var(--primary-light);
  border-radius: 10px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border: 1px solid var(--light-silver);
  transition: box-shadow 0.2s ease;
}

.stat-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  color: var(--theme-secondary);
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  font-family: var(--family-jakarta-sans);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.dashboard-quick-links {
  margin-top: 0.5rem;
}

.quick-links-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.875rem;
  font-family: var(--family-urbanist-sans);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.quick-link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--primary-light);
  border: 1px solid var(--light-silver);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.quick-link-card:hover {
  background: var(--text-dark);
  color: var(--white);
  border-color: var(--text-dark);
}

.quick-link-card .arrow-icon {
  margin-left: auto;
  flex-shrink: 0;
}

.quick-link-card.logout {
  color: var(--sale-red);
  border-color: var(--discount-bg);
  background: var(--discount-bg);
}

.quick-link-card.logout:hover {
  background: var(--sale-red);
  color: var(--white);
  border-color: var(--sale-red);
}

/* ── Status Badges ───────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.status-badge-lg {
  padding: 6px 16px;
  font-size: 0.9375rem;
}

.status-processing  { background: #fff3cd; color: #856404; }
.status-completed   { background: #d4edda; color: #155724; }
.status-cancelled   { background: var(--discount-bg); color: var(--sale-red); }
.status-failed      { background: var(--discount-bg); color: var(--sale-red); }
.status-on-hold     { background: #fde8d0; color: #7c4a00; }
.status-pending     { background: #e2e3e5; color: #383d41; }
.status-refunded    { background: #d1ecf1; color: #0c5460; }

/* ── Orders Table ────────────────────────────────────────── */
.orders-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.orders-table thead tr {
  border-bottom: 2px solid var(--light-silver);
}

.orders-table thead th {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem 0.75rem 0;
  text-align: left;
  white-space: nowrap;
}

.orders-table tbody .order-row {
  border-bottom: 1px solid var(--light-silver);
  transition: background-color 0.15s ease;
}

.orders-table tbody .order-row:last-child {
  border-bottom: none;
}

.orders-table tbody .order-row:hover {
  background-color: var(--primary-light);
}

.orders-table td {
  padding: 1rem 1rem 1rem 0;
  vertical-align: middle;
  font-size: 0.9375rem;
  color: var(--text-dark);
}

.order-number-link {
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  display: block;
}

.order-number-link:hover {
  color: var(--theme-secondary);
  text-decoration: underline;
}

.order-items-count {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.order-date {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.order-total {
  font-weight: 600;
  font-family: var(--family-jakarta-sans);
}

.btn-view-order {
  display: inline-block;
  padding: 6px 16px;
  background: var(--text-dark);
  color: var(--white);
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-view-order:hover {
  background: var(--app-light-theme);
  color: var(--white);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  color: var(--light-silver);
  margin-bottom: 1.25rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-family: var(--family-urbanist-sans);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── View Order ──────────────────────────────────────────── */
.view-order-back {
  margin-bottom: 1.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-dark);
}

.view-order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--light-silver);
}

.order-meta-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

/* Tracking Timeline */
.tracking-timeline-wrapper {
  background: var(--primary-light);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tracking-timeline {
  display: flex;
  align-items: flex-start;
  min-width: 520px;
  position: relative;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 2;
  border: 2px solid var(--light-silver);
  background: var(--white);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-done .step-circle {
  background: var(--text-dark);
  border-color: var(--text-dark);
  color: var(--white);
}

.step-current .step-circle {
  background: var(--white);
  border-color: var(--text-dark);
  border-width: 3px;
  color: var(--text-dark);
  box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.12);
}

.step-connector {
  position: absolute;
  top: 17px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--light-silver);
  z-index: 1;
}

.connector-done {
  background: var(--text-dark);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
  max-width: 80px;
  line-height: 1.3;
}

.step-done .step-label,
.step-current .step-label {
  color: var(--text-dark);
}

/* Order Sections */
.order-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-silver);
}

.order-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.order-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-family: var(--family-urbanist-sans);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.order-item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--light-silver);
}

.order-item-row:last-child {
  border-bottom: none;
}

.order-item-image img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--light-silver);
  flex-shrink: 0;
}

.order-item-details {
  flex: 1;
}

.item-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 4px;
}

.item-name a {
  color: var(--text-dark);
  text-decoration: none;
}

.item-name a:hover {
  text-decoration: underline;
}

.item-qty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.order-item-price {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-dark);
  font-family: var(--family-jakarta-sans);
  white-space: nowrap;
}

/* Order Totals */
.order-totals {
  max-width: 360px;
  margin-left: auto;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--light-silver);
  font-size: 0.9375rem;
}

.totals-row:last-child {
  border-bottom: none;
}

.totals-label {
  color: var(--text-muted);
  font-weight: 500;
}

.totals-value {
  font-weight: 600;
  color: var(--text-dark);
  font-family: var(--family-jakarta-sans);
}

.totals-total {
  padding-top: 0.875rem;
  margin-top: 0.25rem;
  border-top: 2px solid var(--text-dark);
  border-bottom: none;
}

.totals-total .totals-label,
.totals-total .totals-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
}

.discount-row .totals-value {
  color: var(--sale-red);
}

/* Addresses */
.order-addresses {
  margin-top: 0.5rem;
}

.order-address {
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--text-dark);
  line-height: 1.7;
}

.address-phone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

/* ── Edit Account ────────────────────────────────────────── */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--light-silver);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.25rem;
  font-family: var(--family-urbanist-sans);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-family: var(--family-urbanist-sans);
}

.required {
  color: var(--sale-red);
}

.theme-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--light-silver);
  border-radius: 6px;
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  font-family: var(--family-urbanist-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  appearance: none;
}

.theme-input:focus {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.theme-input::placeholder {
  color: var(--placeholder-text);
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.375rem 0 0;
}

/* Password toggle */
.password-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--primary-light);
  border: 1.5px solid var(--light-silver);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  font-family: var(--family-urbanist-sans);
  transition: all 0.2s ease;
}

.password-toggle-btn:hover {
  border-color: var(--text-dark);
}

.toggle-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.password-fields {
  display: none;
}

.password-fields.open {
  display: block;
}

/* Password field with eye */
.password-field-wrap {
  position: relative;
}

.password-field-wrap .theme-input {
  padding-right: 2.75rem;
}

.password-eye-btn {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--placeholder-text);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.password-eye-btn:hover {
  color: var(--text-dark);
}

/* Form Actions */
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-theme-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--text-dark);
  color: var(--white);
  border: 2px solid var(--text-dark);
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--family-urbanist-sans);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn-theme-primary:hover {
  background: var(--app-light-theme);
  border-color: var(--app-light-theme);
  color: var(--white);
}

.btn-theme-primary.btn-full {
  width: 100%;
  text-align: center;
  display: block;
}

.btn-theme-secondary {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--text-dark);
  border: 2px solid var(--light-silver);
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--family-urbanist-sans);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn-theme-secondary:hover {
  border-color: var(--text-dark);
  background: var(--primary-light);
  color: var(--text-dark);
}

/* ── Login / Register Page ───────────────────────────────── */
.myaccount-login-page {
  background-color: var(--primary-light);
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  max-width: 520px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.login-tabs {
  display: flex;
  position: relative;
  background: var(--primary-light);
  border-bottom: 2px solid var(--light-silver);
}

.login-tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--family-urbanist-sans);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.login-tab.active {
  color: var(--text-dark);
  background: var(--white);
}

.login-panel {
  padding: 2rem;
}

.login-panel.hidden {
  display: none;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  font-family: var(--family-urbanist-sans);
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--text-dark);
  cursor: pointer;
}

.lost-password-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.lost-password-link:hover {
  color: var(--text-dark);
  text-decoration: underline;
}

.privacy-notice {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.privacy-notice a {
  color: var(--text-dark);
  text-decoration: underline;
}

.register-disabled-notice {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* ── WooCommerce Notice Overrides ────────────────────────── */
.myaccount-content-card .woocommerce-message,
.myaccount-content-card .woocommerce-info,
.myaccount-content-card .woocommerce-error {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-left-width: 4px;
  border-left-style: solid;
  font-size: 0.9375rem;
  list-style: none;
}

.myaccount-content-card .woocommerce-message {
  background: #d4edda;
  border-left-color: #28a745;
  color: #155724;
}

.myaccount-content-card .woocommerce-info {
  background: #d1ecf1;
  border-left-color: #17a2b8;
  color: #0c5460;
}

.myaccount-content-card .woocommerce-error {
  background: var(--discount-bg);
  border-left-color: var(--sale-red);
  color: #721c24;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .myaccount-sidebar {
    position: static;
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  .myaccount-content-card {
    padding: 1.25rem;
  }

  .view-order-header {
    flex-direction: column;
  }

  .tracking-timeline-wrapper {
    padding: 1.25rem 1rem;
  }

  .order-totals {
    max-width: 100%;
  }

  .login-panel {
    padding: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-theme-primary,
  .btn-theme-secondary {
    text-align: center;
    width: 100%;
    display: block;
  }

  .orders-table thead th:nth-child(2),
  .orders-table td:nth-child(2) {
    display: none;
  }
}
