/* Matgary Account Portal — Petrol Blue #0f4c5c & Ember Orange #e36414 */

.acct-wrap {
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 20px;
  padding-block: 28px 70px;
  display: grid;
  gap: 24px;
}

/* ==========================================================================
   Dashboard Top (2-Column Structured Layout: Profile + 2 Metrics)
   ========================================================================== */
.acct-dashboard-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 860px) {
  .acct-dashboard-top {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Profile Header Card */
.acct-profile-card {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #edf2f7);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.acct-profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 4px;
  background: linear-gradient(90deg, #0f4c5c 0%, #1a7a94 65%, #e36414 100%);
}

.acct-profile-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.acct-avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f4c5c 0%, #176579 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  font-weight: 800;
  flex: none;
  box-shadow: 0 4px 14px rgba(15, 76, 92, 0.25);
  border: 3px solid #ffffff;
}

.acct-user-info {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 190px;
}

.acct-user-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.acct-user-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-text, #1a202c);
  line-height: 1.25;
}

.acct-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff4ed;
  color: #c4520f;
  border: 1px solid rgba(227, 100, 20, 0.25);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.acct-contact-details {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted, #718096);
  font-size: 0.88rem;
  font-weight: 500;
}

.contact-pill .icon {
  width: 15px;
  height: 15px;
  color: #0f4c5c;
  flex: none;
}

.acct-profile-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border, #edf2f7);
  padding-top: 14px;
  margin-top: auto;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #b91c1c;
  border: 1.5px solid #fee2e2;
  border-radius: 12px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-logout .icon {
  color: inherit;
  transition: transform 0.18s ease;
}

.btn-logout:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.12);
}

.btn-logout:hover .icon {
  transform: translateX(-2px);
}

[dir="ltr"] .btn-logout:hover .icon {
  transform: translateX(2px);
}

.btn-logout:active {
  transform: scale(0.98);
}

/* 2 Summary Metrics Grid */
.acct-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 520px) {
  .acct-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.acct-metric-card {
  padding: 22px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius-lg, 18px);
  background: #ffffff;
  border: 1px solid var(--color-border, #edf2f7);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.acct-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 76, 92, 0.08);
}

.metric-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
}

.metric-total .metric-icon-wrap {
  background: #e0eef2;
  color: #0f4c5c;
}

.metric-total .metric-icon-wrap .icon {
  color: #0f4c5c;
  width: 24px;
  height: 24px;
}

.metric-active .metric-icon-wrap {
  background: #fff3eb;
  color: #e36414;
}

.metric-active .metric-icon-wrap .icon {
  color: #e36414;
  width: 24px;
  height: 24px;
}

.metric-info {
  display: grid;
  gap: 2px;
}

.metric-title {
  color: var(--color-muted, #718096);
  font-size: 0.85rem;
  font-weight: 700;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text, #1a202c);
}

.metric-total .metric-value {
  color: #0f4c5c;
}

.metric-active .metric-value {
  color: #e36414;
}

/* ==========================================================================
   Guest / Auth Card (Login & Registration)
   ========================================================================== */
.acct-auth {
  padding: 36px 32px;
  display: grid;
  gap: 18px;
  max-width: 480px;
  margin-inline: auto;
  width: 100%;
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 10px 30px rgba(15, 76, 92, 0.08);
  border: 1px solid var(--color-border, #edf2f7);
  background: #ffffff;
}

.auth-card-top {
  text-align: center;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.auth-icon-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #e0eef2;
  color: #0f4c5c;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.auth-icon-badge .icon {
  color: #0f4c5c;
  width: 26px;
  height: 26px;
}

.auth-card-top h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f4c5c;
}

.auth-card-top p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.acct-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.acct-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 10px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  color: #64748b;
  transition: all 0.16s ease;
}

.acct-tabs button.on {
  background: #0f4c5c;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 76, 92, 0.22);
}

.acct-msg {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acct-msg.err {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.acct-msg.ok {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Guest prompt for orders */
.acct-guest-prompt {
  padding: 36px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 600px;
  margin-inline: auto;
  width: 100%;
  border-radius: var(--radius-lg, 18px);
}

.guest-prompt-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: #e0eef2;
  color: #0f4c5c;
  display: grid;
  place-items: center;
}

.guest-prompt-icon .icon {
  color: #0f4c5c;
  width: 24px;
  height: 24px;
}

.acct-guest-prompt h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}

.acct-guest-prompt p {
  margin: 0;
  max-width: 440px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==========================================================================
   Orders Section & History List
   ========================================================================== */
.acct-orders-sec {
  display: grid;
  gap: 18px;
}

.acct-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-inline: 4px;
}

.sec-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title-wrap .icon {
  color: #0f4c5c;
  width: 22px;
  height: 22px;
}

.sec-title-wrap h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f4c5c;
}

.acct-count-badge {
  background: #e0eef2;
  color: #0f4c5c;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 10px;
}

.acct-empty {
  padding: 56px 20px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  border-radius: var(--radius-lg, 18px);
}

.acct-empty[hidden],
#emptyOrders[hidden],
#ordersEmpty[hidden],
#addressesEmpty[hidden] {
  display: none !important;
}

.empty-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  color: #94a3b8;
}

.empty-icon-box .icon {
  color: #94a3b8;
}

.acct-empty h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.acct-empty p {
  margin: 0;
  color: var(--color-muted);
  max-width: 420px;
  font-size: 0.92rem;
}

.orders-list {
  display: grid;
  gap: 16px;
}

/* Order Card Styling */
.order-card {
  padding: 22px 24px;
  display: grid;
  gap: 16px;
  border-radius: var(--radius-lg, 18px);
  border: 1px solid var(--color-border, #edf2f7);
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  background: #ffffff;
}

.order-card:hover {
  box-shadow: 0 8px 24px rgba(15, 76, 92, 0.08);
}

.order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border, #edf2f7);
}

.order-top-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.order-code {
  font-family: monospace, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f4c5c;
  background: #f0f7f9;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #d0e4ea;
}

.order-date {
  color: var(--color-muted, #718096);
  font-size: 0.86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.order-date .icon {
  width: 15px;
  height: 15px;
  color: #718096;
}

/* Status Badges */
.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.st::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.st-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.st-confirmed { background: #e0eef2; color: #0f4c5c; border: 1px solid #b8dbe3; }
.st-preparing { background: #e0eef2; color: #0f4c5c; border: 1px solid #b8dbe3; }
.st-out { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.st-delivered { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.st-cancelled { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Order Items Thumbnail Rows */
.order-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.order-items li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.order-items img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.oi-info {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.oi-info strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text, #1a202c);
  overflow-wrap: anywhere;
}

.oi-info span {
  color: var(--color-muted, #718096);
  font-size: 0.82rem;
  font-weight: 500;
}

.oi-total {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f4c5c;
  white-space: nowrap;
}

/* Order Summary & Footer */
.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--color-border, #edf2f7);
}

.order-meta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.meta-total {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.meta-total .meta-label {
  color: var(--color-muted, #718096);
  font-weight: 600;
}

.meta-total strong {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f4c5c;
}

.meta-pay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted, #718096);
  font-size: 0.84rem;
  font-weight: 600;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 8px;
}

.meta-pay strong {
  color: var(--color-text, #1a202c);
}

.btn-reorder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e36414;
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(227, 100, 20, 0.28);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-reorder:hover {
  background: #c4520f;
  box-shadow: 0 4px 12px rgba(227, 100, 20, 0.36);
  transform: translateY(-1px);
}

.btn-reorder:active {
  transform: translateY(1px) scale(0.98);
}

.btn-reorder .icon {
  color: inherit;
  width: 16px;
  height: 16px;
}

.reorder-feedback {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: #fff4ed;
  color: #c4520f;
  border: 1px solid rgba(227, 100, 20, 0.2);
}

@media (max-width: 640px) {
  .acct-wrap {
    padding-inline: 14px;
    padding-block: 18px 40px;
  }
  .acct-profile-card {
    padding: 18px;
  }
  .acct-auth {
    padding: 24px 18px;
  }
  .order-card {
    padding: 16px 14px;
  }
  .order-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .order-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-reorder {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Saved Addresses Section & Address Cards
   ========================================================================== */
.acct-addresses-sec {
  display: grid;
  gap: 18px;
}

.acct-new-address-card {
  padding: 24px;
  border-radius: var(--radius-lg, 18px);
  border: 1.5px solid rgba(15, 76, 92, 0.2);
  background: #fdfefe;
  display: grid;
  gap: 16px;
  animation: fadeInDown 0.2s ease-out;
}

.acct-new-address-card[hidden] {
  display: none !important;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.new-addr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.new-addr-head h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f4c5c;
}

.new-addr-form {
  display: grid;
  gap: 16px;
}

.label-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.label-chip:has(input:checked) {
  background: rgba(15, 76, 92, 0.12);
  color: #0f4c5c;
  border-color: rgba(15, 76, 92, 0.3);
}

.label-chip input {
  accent-color: #0f4c5c;
}

.addr-form-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .addr-form-grid {
    grid-template-columns: 1fr;
  }
}

.checkbox-field {
  margin-top: -4px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0f4c5c;
  cursor: pointer;
}

.new-addr-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Addresses Grid & Individual Cards */
.addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.addr-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg, 18px);
  background: #ffffff;
  border: 1.5px solid var(--color-border, #edf2f7);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  transition: all 0.18s ease;
}

.addr-card.is-default {
  border-color: rgba(15, 76, 92, 0.4);
  background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
  box-shadow: 0 4px 14px rgba(15, 76, 92, 0.08);
}

.addr-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.addr-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.addr-label-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 8px;
  background: #e0eef2;
  color: #0f4c5c;
}

.addr-default-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4ed;
  color: #c4520f;
  border: 1px solid rgba(227, 100, 20, 0.25);
}

.btn-addr-del {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.btn-addr-del:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.addr-card-body {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text, #1e293b);
  line-height: 1.5;
  word-break: break-word;
}

.addr-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted, #64748b);
  font-size: 0.84rem;
  font-weight: 600;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  margin-top: 4px;
}

.addr-card-foot .icon {
  color: #0f4c5c;
  width: 15px;
  height: 15px;
}

