/* ==========================================================================
   Favorites / Wishlist – Page layout, card grid, heart button & empty-state
   ========================================================================== */

/* ---------- Design-token variables (same defaults as archive) ---------- */

:root {
  --as24ci-color-primary: #004b8d;
  --as24ci-color-primary-hover: #003a6d;
  --as24ci-color-primary-border: #003a6d;
  --as24ci-color-text: #222222;
  --as24ci-color-heading: #004b8d;
  --as24ci-color-bg: #ffffff;
  --as24ci-color-bg-soft: #f9fafb;
  --as24ci-color-border: #e5e7eb;
  --as24ci-color-accent: #005a9c;
  --as24ci-color-button: #004b8d;
  --as24ci-title-font-size: 1.25rem;
  --as24ci-price-font-size: 1.1rem;
  --as24ci-radius: 10px;
  --as24ci-shadow-card-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --as24ci-shadow-button: 0 3px 8px rgba(15, 23, 42, 0.2);
  --as24ci-shadow-button-hover: 0 4px 12px rgba(15, 23, 42, 0.25);
}

/* ---------- Page wrapper ---------- */

.as24ci-favorites-page,
.as24ci-favorites-page * {
  font-family: var(--as24ci-font-family, inherit);
  color: var(--as24ci-color-text);
  box-sizing: border-box;
}

.as24ci-favorites-page {
  background: #ffffff;
  padding: 32px 0 48px;
  max-width: none;
  /* Break out of narrow theme containers so the inner wrapper can reach 1440 px */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow-x: hidden;
}

/* ---------- Inner wrapper (1440 px cap) ---------- */

.as24ci-favorites-inner {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto 32px;
}

@media (max-width: 1100px) {
  .as24ci-favorites-inner {
    width: min(1440px, calc(100% - 32px));
  }
}

@media (max-width: 960px) {
  .as24ci-favorites-inner {
    width: calc(100% - 24px);
  }
}

/* ---------- Card grid ---------- */

.as24ci-favorites-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1200px) {
  .as24ci-favorites-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .as24ci-favorites-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* ---------- Vehicle card ---------- */

.as24ci-favorites-row {
  background: var(--as24ci-color-bg);
  border-radius: 12px;
  border: 1px solid var(--as24ci-color-border);
  box-shadow: var(--as24ci-shadow-card-soft);
  overflow: hidden;
}

.as24ci-favorites-row-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.as24ci-favorites-row-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--as24ci-color-border);
}

.as24ci-favorites-row-thumb img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.as24ci-favorites-row-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.as24ci-favorites-row-title {
  margin: 0;
  font-size: var(--as24ci-font-size-title, inherit);
  font-weight: 800;
  color: var(--as24ci-color-title, inherit);
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.as24ci-favorites-row-price {
  font-size: var(--as24ci-price-font-size);
  font-weight: 900;
  color: var(--as24ci-color-text, inherit);
  margin: 0;
}

.as24ci-favorites-row-facts--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

.as24ci-favorites-page .as24ci-fact--plain {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--as24ci-color-text, inherit);
  font-size: var(--as24ci-font-size-text, 14px);
  font-weight: 500;
}

.as24ci-favorites-row-side {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.as24ci-btn.as24ci-favorites-row-cta {
  width: 100%;
  text-align: center;
  white-space: nowrap;
  background: var(--as24ci-color-button);
  color: #ffffff;
  border: 1px solid var(--as24ci-color-primary-border);
  border-radius: 10px;
  padding: var(--as24ci-btn-padding, 9px 18px);
  font-weight: 700;
  box-shadow: var(--as24ci-shadow-button);
  font-size: var(--as24ci-btn-font-size, 14px);
}

.as24ci-btn.as24ci-favorites-row-cta:hover {
  background: var(--as24ci-color-primary-hover);
  box-shadow: var(--as24ci-shadow-button-hover);
}

/* ---------- Star button ---------- */

.as24ci-fav-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
	color: #333;
	line-height: 1;
}

/* Active / hover state: darker red passes WCAG AA text (4.5:1) on white.
 * Border #c62828 ≈ 5.55:1 on #fff (UI ≥3:1, comfortably AA non-text);
 * text #b71c1c ≈ 7.0:1 on #fff (AAA). Replaces former #e53935 (3.84:1). */
.as24ci-fav-btn:hover {
	border-color: #c62828;
	color: #b71c1c;
}

.as24ci-fav-btn.as24ci-fav-active {
	border-color: #c62828;
	color: #b71c1c;
	background: #fff5f5;
}

.as24ci-fav-btn .as24ci-fav-heart {
	font-size: 18px;
	line-height: 1;
	display: inline-block;
}

.as24ci-fav-btn--overlay .as24ci-fav-heart {
	font-size: 13px; /* proportional to the 24 px circle (was 18 px for 36 px) */
}

.as24ci-fav-btn.as24ci-fav-active .as24ci-fav-heart {
	color: #b71c1c;
}

/* ---------- Heart icon (SVG): outline by default, filled when active ---------- */
.as24ci-fav-heart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.as24ci-fav-btn .as24ci-fav-heart svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.as24ci-fav-btn.as24ci-fav-active .as24ci-fav-heart svg {
	fill: currentColor;
	stroke: currentColor;
}

.as24ci-fav-btn--overlay .as24ci-fav-heart svg {
	width: 14px;
	height: 14px;
}

/* ---------- Counter badge ---------- */

.as24ci-fav-counter {
	position: relative;
	display: inline-block;
}

.as24ci-fav-counter__badge {
	position: absolute;
	top: -6px;
	right: -8px;
	background: #e53935;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	min-width: 16px;
	height: 16px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

/* ---------- Overlay star (archive grid thumbnails) ---------- */

.as24ci-fav-btn--overlay {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	width: 24px;
	height: 24px;
	padding: 0;
	justify-content: center;
	gap: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	border-color: transparent;
}

.as24ci-fav-btn--overlay:hover {
	background: #fff;
	border-color: transparent;
}

.as24ci-fav-btn--overlay.as24ci-fav-active {
	background: #fff5f5;
	border-color: transparent;
}

.as24ci-fav-btn--overlay .as24ci-fav-heart {
	/* Solid slate replaces former rgba(50,50,50,0.5) (≈2.85:1 on white,
	   failed WCAG 1.4.11). #374151 reaches ~9:1 on white and ~8:1 on the
	   semi-transparent white overlay background. */
	color: #374151;
}

.as24ci-fav-btn--overlay:hover .as24ci-fav-heart,
.as24ci-fav-btn--overlay.as24ci-fav-active .as24ci-fav-heart {
	color: #b71c1c;
}

/* ---------- Empty state ---------- */

.as24ci-favorites-empty {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-size: 16px;
}
