:root {
  --fav-blue: #0b2e6b;
  --fav-green: #67c23a;
  --fav-yellow: #ffc72c;
  --fav-bg: #f5f7fb;
  --fav-text: #10213d;
  --fav-muted: #66758c;
  --fav-border: #dfe6f0;
  --fav-surface: #ffffff;
  --fav-shadow: 0 18px 48px rgba(11, 46, 107, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, system-ui, sans-serif;
  color: var(--fav-text);
  background: var(--fav-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(103, 194, 58, 0.08), transparent 28rem),
    var(--fav-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--fav-yellow);
  color: var(--fav-blue);
  font-weight: 800;
}

.favorites-shell {
  width: min(calc(100% - 40px), 1420px);
  margin-inline: auto;
}

.favorites-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(213, 222, 235, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.favorites-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
}

.favorites-brand {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 14px;
  background: #fff;
}

.favorites-brand img {
  width: auto;
  height: 46px;
}

.favorites-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorites-nav a {
  padding: 12px 15px;
  border-radius: 13px;
  color: var(--fav-blue);
  font-size: 0.91rem;
  font-weight: 750;
}

.favorites-nav a:hover,
.favorites-nav a:focus-visible {
  background: #edf3fb;
}

.favorites-nav .favorites-publish {
  margin-left: 8px;
  padding-inline: 20px;
  background: var(--fav-yellow);
}

.favorites-main {
  padding-block: 46px 90px;
}

.favorites-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.favorites-kicker {
  margin: 0 0 10px;
  color: #4d9f29;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.favorites-hero h1 {
  margin: 0;
  color: var(--fav-blue);
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.favorites-hero p:not(.favorites-kicker) {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--fav-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.favorites-total {
  flex: 0 0 auto;
  min-width: 190px;
  padding: 20px 24px;
  border: 1px solid var(--fav-border);
  border-radius: 22px;
  background: var(--fav-surface);
  box-shadow: var(--fav-shadow);
}

.favorites-total strong,
.favorites-total span {
  display: block;
}

.favorites-total strong {
  color: var(--fav-blue);
  font-size: 2rem;
  line-height: 1;
}

.favorites-total span {
  margin-top: 7px;
  color: var(--fav-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.favorites-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--fav-border);
  border-radius: 24px;
  background: var(--fav-surface);
  box-shadow: var(--fav-shadow);
}

.favorites-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #d8e1ed;
  border-radius: 15px;
  background: #f9fbfd;
}

.favorites-search:focus-within {
  border-color: rgba(11, 46, 107, 0.42);
  box-shadow: 0 0 0 4px rgba(11, 46, 107, 0.07);
}

.favorites-search svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #7a899e;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.favorites-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fav-text);
}

.favorites-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fav-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.favorites-sort select {
  min-height: 50px;
  padding: 0 42px 0 15px;
  border: 1px solid #d8e1ed;
  border-radius: 15px;
  background: #fff;
  color: var(--fav-blue);
  font-weight: 750;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.favorite-card,
.favorite-skeleton {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--fav-border);
  border-radius: 22px;
  background: var(--fav-surface);
  box-shadow: var(--fav-shadow);
}

.favorite-card {
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.favorite-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 54px rgba(11, 46, 107, 0.13);
}

.favorite-card__image {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #edf1f6;
}

.favorite-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-card__remove {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(11, 46, 107, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #d6285b;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(12, 32, 65, 0.14);
}

.favorite-card__remove:hover {
  transform: scale(1.05);
  background: #fff1f5;
}

.favorite-card__remove svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.favorite-card__body {
  padding: 15px 16px 17px;
}

.favorite-card__status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf6e8;
  color: #438125;
  font-size: 0.68rem;
  font-weight: 850;
}

.favorite-card__status[data-status="sold"],
.favorite-card__status[data-status="paused"] {
  background: #f0f2f5;
  color: #6b7584;
}

.favorite-card h2 {
  margin: 11px 0 0;
  color: var(--fav-blue);
  font-size: 0.98rem;
  line-height: 1.35;
  overflow-wrap: normal;
}

.favorite-card__price {
  margin: 8px 0 0;
  color: var(--fav-blue);
  font-size: 1.35rem;
  font-weight: 900;
}

.favorite-card__meta {
  margin: 8px 0 0;
  color: var(--fav-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.favorite-skeleton {
  min-height: 390px;
  background:
    linear-gradient(100deg, transparent 20%, rgba(255,255,255,.68) 40%, transparent 60%) -500px 0 / 500px 100% no-repeat,
    linear-gradient(#e8edf4 0 0) 0 0 / 100% 68% no-repeat,
    #f4f6f9;
  animation: favorite-shimmer 1.3s infinite;
}

.favorites-empty,
.favorites-error {
  margin-top: 28px;
  padding: 64px 24px;
  border: 1px dashed #cdd8e7;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.favorites-empty__icon {
  color: var(--fav-green);
  font-size: 4rem;
  line-height: 1;
}

.favorites-empty h2,
.favorites-error h2 {
  margin: 16px 0 0;
  color: var(--fav-blue);
}

.favorites-empty p,
.favorites-error p {
  margin: 10px auto 0;
  max-width: 520px;
  color: var(--fav-muted);
  line-height: 1.6;
}

.favorites-empty a,
.favorites-error button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 22px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--fav-blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.favorites-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 15px;
  background: #0b2e6b;
  color: #fff;
  box-shadow: 0 18px 44px rgba(11, 46, 107, 0.25);
  font-weight: 750;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(103, 194, 58, 0.05), transparent 28rem),
    #07090c !important;
}

html[data-theme="dark"] .favorites-header {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(8, 10, 13, 0.92);
}

html[data-theme="dark"] .favorites-nav a {
  color: #c2cad5;
}

html[data-theme="dark"] .favorites-nav a:hover {
  background: #151a21;
  color: #fff;
}

html[data-theme="dark"] .favorites-nav .favorites-publish {
  color: #0a1d3d;
  background: var(--fav-yellow);
}

html[data-theme="dark"] :is(
  .favorites-total,
  .favorites-toolbar,
  .favorite-card,
  .favorites-empty,
  .favorites-error
) {
  border-color: rgba(255, 255, 255, 0.09);
  background: #0f1318;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] :is(.favorites-hero h1, .favorites-total strong, .favorite-card h2, .favorite-card__price, .favorites-empty h2, .favorites-error h2) {
  color: #f5f7fa;
}

html[data-theme="dark"] :is(.favorites-hero p:not(.favorites-kicker), .favorites-total span, .favorite-card__meta, .favorites-empty p, .favorites-error p) {
  color: #a7b0bd;
}

html[data-theme="dark"] :is(.favorites-search, .favorites-sort select) {
  border-color: rgba(255, 255, 255, 0.1);
  background: #161b22;
  color: #f5f7fa;
}

html[data-theme="dark"] .favorites-search input {
  color: #f5f7fa;
  background: transparent !important;
}

html[data-theme="dark"] .favorite-card__remove {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(16, 20, 26, 0.94);
}

@media (max-width: 1180px) {
  .favorites-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .favorites-header__inner,
  .favorites-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .favorites-header__inner {
    padding-block: 12px;
  }

  .favorites-nav {
    width: 100%;
    overflow-x: auto;
  }

  .favorites-nav a {
    flex: 0 0 auto;
  }

  .favorites-total {
    min-width: 0;
  }

  .favorites-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .favorites-shell {
    width: min(calc(100% - 24px), 1420px);
  }

  .favorites-main {
    padding-top: 32px;
  }

  .favorites-toolbar {
    grid-template-columns: 1fr;
  }

  .favorites-sort {
    align-items: stretch;
    flex-direction: column;
  }

  .favorites-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .favorites-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes favorite-shimmer {
  to {
    background-position: 500px 0, 0 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .favorite-card,
  .favorite-skeleton {
    transition: none;
    animation: none;
  }
}
