/* ==========================================================
   Petshop — Account pages (Profile / Orders / Change password)
   Colours from theme tokens (--theme-*)
   ========================================================== */

.t1-profile {
  --p-navy: var(--theme-header-bg, var(--color-headerBg, #1a2b4b));
  --p-deep: var(--theme-header-nav-bg, var(--color-headerNavBg, #152238));
  --p-primary: var(--theme-primary, var(--color-primary, #00b72f));
  --p-primary-dark: var(--theme-accent-dark, var(--color-accentDark, #008f25));
  --p-muted: var(--theme-muted, var(--color-muted, #5f6f69));
  --p-line: var(--theme-border, var(--color-border, #d9d9d4));
  --p-soft: #ffffff;
  --p-surface: var(--theme-surface, var(--color-surfaceCard, #ffffff));
  --p-text: var(--theme-text, var(--color-secondary, #0f2f2c));
  --p-danger: var(--theme-danger, var(--color-danger, #b91c1c));
  --p-active-bg: color-mix(in srgb, var(--p-primary) 14%, transparent);
  --p-card-shadow: var(--theme-shadow, 0 8px 28px rgba(15, 23, 42, 0.06));
  --p-radius: var(--theme-radius, 10px);
  --p-font: var(--theme-font-family, Inter, system-ui, sans-serif);

  width: 100%;
  min-height: calc(100vh - 120px);
  padding: 36px 0 56px;
  background: var(--p-soft);
  box-sizing: border-box;
  color: var(--p-text);
  font-family: var(--p-font);
}

.t1-profile__layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.t1-profile__sidebar,
.t1-profile__main {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: calc(var(--p-radius) + 6px);
  box-shadow: var(--p-card-shadow);
  box-sizing: border-box;
}

.t1-profile__sidebar {
  padding: 22px 18px;
  position: sticky;
  top: 112px;
}

.t1-profile__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--p-line);
}

.t1-profile__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--p-primary);
  color: var(--theme-text-inverse, #fff);
  font-family: var(--p-font);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--p-primary) 28%, transparent);
}

.t1-profile__user-meta {
  min-width: 0;
}

.t1-profile__user-name {
  margin: 0 0 2px;
  font-family: var(--p-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--p-navy);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t1-profile__user-email {
  margin: 0;
  font-family: var(--p-font);
  font-size: 12px;
  color: var(--p-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t1-profile__menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t1-profile__menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--p-radius);
  background: transparent;
  color: var(--theme-text-secondary, #1f3f3a);
  font-family: var(--p-font);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.18s ease, color 0.18s ease;
}

.t1-profile__menu-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--p-muted);
}

.t1-profile__menu-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.t1-profile__menu-link:hover {
  background: color-mix(in srgb, var(--p-primary) 10%, transparent);
  color: var(--p-navy);
}

.t1-profile__menu-link:hover .t1-profile__menu-icon {
  color: var(--p-primary);
}

.t1-profile__menu-link.is-active {
  background: var(--p-active-bg);
  color: var(--p-primary-dark);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--p-primary) 12%, transparent);
}

.t1-profile__menu-link.is-active .t1-profile__menu-icon {
  color: var(--p-primary);
}

.t1-profile__sidebar-foot {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--p-line);
}

.t1-profile__logout:hover {
  background: color-mix(in srgb, var(--p-danger) 10%, transparent);
  color: var(--p-danger);
}

.t1-profile__logout:hover .t1-profile__menu-icon {
  color: var(--p-danger);
}

/* Main card */
.t1-profile__main {
  padding: 32px 34px;
  min-width: 0;
}

.t1-profile__main-head {
  margin-bottom: 22px;
}

.t1-profile__main-title {
  margin: 0 0 6px;
  font-family: var(--p-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--p-navy);
  line-height: 1.2;
}

.t1-profile__main-lede {
  margin: 0;
  font-family: var(--p-font);
  font-size: 14px;
  color: var(--p-muted);
}

.t1-profile__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 770px;
}

.t1-profile__field {
  display: grid;
  gap: 7px;
}

.t1-profile__field label {
  font-family: var(--p-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--p-navy);
}

.t1-profile__field input,
.t1-profile__field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  color: var(--p-text);
  font-family: var(--p-font);
  font-size: 14.5px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.t1-profile__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6f69' d='M1.4.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  padding-right: 36px;
  cursor: pointer;
}

.t1-profile__field input::placeholder {
  color: color-mix(in srgb, var(--p-muted) 75%, #fff);
}

.t1-profile__field input:focus,
.t1-profile__field select:focus {
  border-color: var(--p-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-primary) 22%, transparent);
}

.t1-profile__field .sf-auth__field-error {
  margin: 0;
  font-family: var(--p-font);
  font-size: 12.5px;
  color: var(--p-danger);
}

.t1-profile__field.is-invalid input,
.t1-profile__field input.is-invalid {
  border-color: var(--p-danger) !important;
  background: color-mix(in srgb, var(--p-danger) 8%, #fff) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-danger) 18%, transparent) !important;
}

.t1-profile__field--password .sf-auth__password-wrap input {
  padding-right: 52px;
}

.t1-profile__actions {
  margin-top: 6px;
}

.t1-profile__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--p-radius);
  background: var(--p-primary);
  color: var(--theme-text-inverse, #fff);
  font-family: var(--p-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--p-primary) 28%, transparent);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.t1-profile__btn:hover {
  background: var(--p-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--p-primary-dark) 32%, transparent);
}

/* Orders table panel */
.t1-profile__orders-panel {
  border: 1px solid var(--p-line);
  border-radius: calc(var(--p-radius) + 2px);
  overflow: hidden;
  background: var(--p-surface);
}

.t1-profile__orders-head {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--p-primary) 10%, var(--p-surface));
  font-family: var(--p-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--p-navy);
}

.t1-profile__orders-body {
  min-height: 120px;
}

.t1-profile__order-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--p-line);
  font-family: var(--p-font);
  font-size: 14px;
  color: var(--theme-text-secondary, #1f3f3a);
  align-items: center;
}

.t1-profile__order-row strong {
  color: var(--p-navy);
  font-weight: 700;
}

.t1-profile__order-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p-primary) 14%, transparent);
  color: var(--p-primary-dark);
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.t1-profile__orders-empty {
  padding: 48px 20px;
  text-align: center;
}

.t1-profile__orders-empty[hidden] {
  display: none !important;
}

.t1-profile__orders-empty p {
  margin: 0 0 10px;
  font-family: var(--p-font);
  font-size: 15px;
  color: var(--p-muted);
}

.t1-profile__orders-empty a {
  font-family: var(--p-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--p-primary);
  text-decoration: none;
}

.t1-profile__orders-empty a:hover {
  color: var(--p-primary-dark);
  text-decoration: underline;
}

.t1-profile .sf-auth__alert {
  margin: 0 0 14px;
}

/* Skeleton loader */
.t1-profile.is-loading [data-profile-content] {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.t1-profile:not(.is-loading) [data-profile-loader] {
  display: none !important;
}

.t1-profile__loader {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.t1-profile__loader-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.t1-profile__loader-card {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: calc(var(--p-radius) + 6px);
  box-shadow: var(--p-card-shadow);
  box-sizing: border-box;
}

.t1-profile__loader-sidebar {
  padding: 22px 18px;
}

.t1-profile__loader-main {
  padding: 32px 34px;
  min-height: 320px;
}

.t1-profile__loader-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--p-line);
}

.t1-profile__loader-user-meta {
  flex: 1;
  display: grid;
  gap: 8px;
}

.t1-profile__loader-menu {
  display: grid;
  gap: 8px;
}

.t1-profile__loader-fields {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.t1-profile__loader-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.t1-profile__loader-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.t1-skel {
  display: block;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--p-line) 70%, #fff) 0%,
    color-mix(in srgb, var(--p-primary) 8%, #fff) 40%,
    color-mix(in srgb, var(--p-line) 70%, #fff) 80%
  );
  background-size: 200% 100%;
  animation: t1-skel-shimmer 1.25s ease-in-out infinite;
  border-radius: var(--p-radius);
}

.t1-skel--avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t1-skel--line {
  height: 12px;
  width: 100%;
  border-radius: 6px;
}

.t1-skel--sm {
  height: 10px;
}

.t1-skel--w40 { width: 40%; }
.t1-skel--w50 { width: 50%; }
.t1-skel--w60 { width: 60%; }
.t1-skel--w90 { width: 90%; }

.t1-skel--nav {
  height: 42px;
  border-radius: var(--p-radius);
}

.t1-skel--nav-foot {
  margin-top: 10px;
}

.t1-skel--title {
  height: 28px;
  width: 42%;
  margin-bottom: 10px;
  border-radius: 8px;
}

.t1-skel--label {
  height: 12px;
  width: 28%;
  margin-top: 8px;
  border-radius: 6px;
}

.t1-skel--input {
  height: 46px;
  width: 100%;
  border-radius: var(--p-radius);
}

.t1-skel--btn {
  height: 46px;
  width: 160px;
  margin-top: 12px;
  border-radius: var(--p-radius);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--p-primary) 18%, transparent) 0%,
    color-mix(in srgb, var(--p-primary) 28%, transparent) 40%,
    color-mix(in srgb, var(--p-primary) 18%, transparent) 80%
  );
  background-size: 200% 100%;
  animation: t1-skel-shimmer 1.25s ease-in-out infinite;
}

.t1-skel--table-head {
  height: 44px;
  border-radius: var(--p-radius) var(--p-radius) 0 0;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--p-primary) 10%, #fff) 0%,
    color-mix(in srgb, var(--p-primary) 6%, #fff) 40%,
    color-mix(in srgb, var(--p-primary) 10%, #fff) 80%
  );
  background-size: 200% 100%;
  animation: t1-skel-shimmer 1.25s ease-in-out infinite;
}

.t1-skel--table-row {
  height: 52px;
}

@keyframes t1-skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 900px) {
  .t1-profile__layout {
    grid-template-columns: 1fr;
  }

  .t1-profile__sidebar {
    position: static;
  }

  .t1-profile__loader-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .t1-profile {
    padding: 20px 0 40px;
  }

  .t1-profile__layout,
  .t1-profile__loader {
    padding: 0 16px;
  }

  .t1-profile__main,
  .t1-profile__loader-main {
    padding: 22px 18px;
  }

  .t1-profile__orders-head,
  .t1-profile__order-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }

  .t1-profile__btn {
    width: 100%;
  }

  .t1-skel--btn {
    width: 100%;
  }
}