/* ==========================================================================
   Utilities
   Small, single-purpose classes used in a handful of places each — not
   worth a dedicated stylesheet the way a full page (shop, cart, checkout)
   is. Login and register share this file's .auth-* layout instead of each
   getting their own near-empty CSS file.
   ========================================================================== */

.hidden { display: none !important; }
.block  { display: block; }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-9 { margin-bottom: var(--space-9); }

.w-full { width: 100%; }

/* --------------------------------------------------------------------- */
/* Auth pages (login / register)                                         */
/* --------------------------------------------------------------------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - 120px);
  padding-block: var(--space-8);
  padding-inline: var(--container-padding);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-7);
}

.auth-card__header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-card__header p {
  margin-top: var(--space-2);
}

.auth-card__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-card__footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.auth-card__footer a {
  color: var(--color-secondary);
  font-weight: var(--fw-medium);
}

.auth-card__footer a:hover {
  text-decoration: underline;
}

.auth-card__forgot {
  align-self: flex-end;
  font-size: var(--fs-xs);
  color: var(--color-secondary);
  margin-top: calc(var(--space-2) * -1);
}

.auth-card__forgot:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------- */
/* Account dashboard                                                     */
/* --------------------------------------------------------------------- */
.account-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-9);
  align-items: start;
}

.account-heading {
  margin-bottom: var(--space-5);
}

.account-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.account-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.account-sidebar__avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
}

.account-sidebar__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.account-nav__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.account-nav__item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.account-nav__item.is-active {
  background: var(--color-primary);
  color: #fff;
}

.account-nav__item--logout {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  color: var(--color-danger);
}

.account-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.account-panel h2 {
  margin-bottom: var(--space-5);
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 420px;
}

.account-form .btn {
  align-self: flex-start;
}

.account-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

/* Address + order cards */
.address-card,
.order-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.address-card + .address-card,
.order-card + .order-card {
  margin-top: var(--space-4);
}

.address-card__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.address-card__actions button {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-secondary);
}

.address-card__actions button:hover {
  text-decoration: underline;
}

.order-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.order-card__id {
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

.order-status {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(var(--color-secondary-rgb), 0.1);
  color: var(--color-secondary);
}

.order-card__items {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.order-card__total {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

.account-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-muted);
}

/* Toggle switch — used for the dark mode setting */
.toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.toggle-switch__track {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-border);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.toggle-switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--duration-fast) var(--ease-out);
}

.toggle-switch__track.is-on {
  background: var(--color-secondary);
}

.toggle-switch__track.is-on::after {
  transform: translateX(20px);
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------- */
/* 404 page                                                               */
/* --------------------------------------------------------------------- */
.not-found-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: var(--space-9);
  min-height: calc(100vh - var(--header-height) - 200px);
  justify-content: center;
}

.not-found-page__code {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 1;
  color: var(--color-secondary);
  margin-bottom: var(--space-4);
}

.not-found-page__message {
  max-width: 480px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.not-found-page__search {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-bottom: var(--space-6);
}

.not-found-page__search input {
  width: 100%;
  height: 48px;
  padding-inline: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
}

.not-found-page__search input:focus-visible {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-focus);
}

.not-found-page__actions {
  display: flex;
  gap: var(--space-3);
}
