/* ═══════════════════════════════════════════════════════════════
   COMMUNITY VISUAL POLISH v5.0 (2026-08-10)
   Final-pass refinements: magazine-grade deal tiles, floating filter
   card, refined typography, icon system, premium micro-interactions.
   Loaded AFTER community.css — overrides only what needs elevating.
   ═══════════════════════════════════════════════════════════════ */

/* ═══ 1. ICON SYSTEM (inline SVG sizing) ═══ */
.meta-icon,
.stat-icon,
.avg-icon,
.cta-arrow {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.cta-arrow {
  width: 14px;
  height: 14px;
  transition: transform var(--dur) var(--ease);
}

.deal-tile__cta:hover .cta-arrow {
  transform: translateX(3px);
}


/* ═══ 2. DEAL TILE — MAGAZINE-GRADE ELEVATION ═══ */

/* Card: subtler border, richer shadow, refined radius */
.deal-tile {
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(26, 31, 46, 0.06);
}

.deal-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(26, 31, 46, 0.18);
  border-color: rgba(13, 92, 99, 0.12);
}

/* Hot card glow — more refined */
.deal-tile--hot {
  box-shadow: 0 2px 8px rgba(26, 31, 46, 0.06), 0 0 0 1px rgba(232, 93, 58, 0.12);
}

.deal-tile--hot:hover {
  box-shadow: 0 20px 40px -12px rgba(26, 31, 46, 0.18), 0 0 30px rgba(232, 93, 58, 0.15);
}


/* ─── SAVINGS BADGE ON IMAGE — prominent, top-left ─── */
.deal-tile__savings-badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 4;
  background: var(--accent);
  color: #fff;
  padding: 7px 14px 6px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(232, 93, 58, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
  margin: 0;
  animation: none;
}

.deal-tile__savings-badge--hot {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 6px 20px rgba(232, 93, 58, 0.5), 0 0 0 1px rgba(232, 93, 58, 0.2);
  animation: savingsGlow 3s ease-in-out infinite;
}

@keyframes savingsGlow {
  0%, 100% { box-shadow: 0 6px 20px rgba(232, 93, 58, 0.5), 0 0 0 1px rgba(232, 93, 58, 0.2); }
  50% { box-shadow: 0 8px 28px rgba(232, 93, 58, 0.6), 0 0 0 2px rgba(232, 93, 58, 0.3); }
}

/* Move heat badge to top-right, smaller, more elegant */
.deal-tile__heat-badge {
  top: var(--sp-3);
  right: var(--sp-3);
  padding: 5px 12px 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: rgba(26, 31, 46, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  letter-spacing: 0.02em;
}

/* Star rating — more subtle, pill style */
.deal-tile__rating {
  bottom: var(--sp-3);
  left: var(--sp-3);
  background: rgba(26, 31, 46, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5px 11px;
  font-size: 0.8125rem;
  border-radius: var(--radius-full);
  letter-spacing: 1px;
}


/* ─── CARD BODY — refined spacing & hierarchy ─── */
.deal-tile__body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Heading row: destination + inline stars */
.deal-tile__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.deal-tile__stars-inline {
  color: #d4a72c;
  font-size: 0.8125rem;
  letter-spacing: 1.5px;
  flex-shrink: 0;
  font-weight: 600;
}

/* Title — tighter, more editorial */
.deal-tile__title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: -2px 0 0;
}

/* Meta row — chips with separators */
.deal-tile__meta {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
}

.deal-tile__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.deal-tile__meta-item--price-night {
  margin-left: auto;
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meta-icon {
  color: var(--text-muted);
  opacity: 0.7;
}

.deal-tile__meta-item--price-night .meta-icon {
  display: none;
}


/* ─── PRICE ROW — clean two-column layout ─── */
.deal-tile__price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  margin-top: auto;
  padding-top: var(--sp-3);
}

.deal-tile__price-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.deal-tile__price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.deal-tile__price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.deal-tile__price-unit {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0;
}

.deal-tile__price-original {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: rgba(232, 93, 58, 0.4);
}

/* CTA — refined, arrow animation */
.deal-tile__cta {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(13, 92, 99, 0.2);
}

/* Avg price — contextual badge with trend */
.deal-tile__avg-price {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
  font-weight: 500;
}

.deal-tile__avg-trend {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--success-light);
  color: var(--success);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-left: 4px;
}

.avg-icon {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}


/* ─── COMMUNITY FOOTER — cleaner, lighter ─── */
.deal-tile__community {
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}

.deal-tile__stats {
  display: flex;
  gap: var(--sp-4);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.deal-tile__stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.stat-icon {
  width: 14px;
  height: 14px;
  opacity: 0.65;
}


/* ═══ 3. FILTER BAR — PREMIUM FLOATING CARD ═══ */
.community-feed {
  padding-top: var(--sp-6);
}

.filter-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin: 0 var(--sp-5) var(--sp-6);
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 20px rgba(26, 31, 46, 0.06);
  position: relative;
}

.filter-bar__inner {
  max-width: none;
  padding: 0;
}

.filter-bar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: flex-end;
}

.filter-group {
  gap: 5px;
}

.filter-group__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.filter-select,
.price-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 140px;
  min-height: 44px;
  transition: all 0.2s var(--ease);
  cursor: pointer;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  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 d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.filter-select:hover,
.price-input:hover {
  border-color: var(--primary);
}

.filter-select:focus,
.price-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 92, 99, 0.1);
}

.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-range span {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.price-input {
  min-width: 78px;
  width: 78px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.filter-reset {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
  cursor: pointer;
}

.filter-reset:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 93, 58, 0.04);
}

/* Active filters — elegant chip row */
.filter-active {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
  background: transparent !important;
  border-radius: 0;
}

.filter-active__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.filter-active__tag {
  background: var(--primary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s var(--ease);
}

.filter-active__tag:hover {
  background: var(--primary-light);
}


/* ═══ 4. SORT TABS — REFINED SEGMENTED CONTROL ═══ */
.community-feed__header {
  align-items: center;
  margin-bottom: var(--sp-5);
}

.community-feed__title {
  letter-spacing: -0.025em;
}

.community-feed__subtitle {
  margin-top: 4px;
  max-width: 420px;
}

.sort-tabs {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.sort-tab {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.25s var(--ease);
}

.sort-tab--active {
  background: var(--bg-elevated);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 31, 46, 0.08), 0 0 0 1px rgba(13, 92, 99, 0.1);
}

.sort-tab--active:active {
  transform: scale(0.97);
}


/* ═══ 5. DEAL GRID — refined gap & rhythm ═══ */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--sp-5);
}

@media (max-width: 480px) {
  .deal-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
}


/* ═══ 6. HERO — richer treatment ═══ */
.hero--community {
  position: relative;
}

.hero--community::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left, rgba(232, 93, 58, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(13, 92, 99, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero--community .hero__inner {
  position: relative;
  z-index: 1;
}

.hero--community .hero__title em::after {
  height: 4px;
  opacity: 0.5;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
}


/* ═══ 7. LIVE TICKER — refined ═══ */
.community-ticker {
  padding: 10px var(--sp-5);
}

.community-ticker__pulse {
  width: 7px;
  height: 7px;
}

.community-ticker__label {
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
}


/* ═══ 8. SKELETON LOADER — smoother shimmer ═══ */
.deal-skeleton__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(
    90deg,
    var(--bg-soft) 0%,
    var(--bg) 50%,
    var(--bg-soft) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

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


/* ═══ 9. CARD ENTRY ANIMATION ═══ */
.deal-tile.deal-tile--animate {
  animation: cardEntry 0.5s var(--ease-out) both;
}

@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger: override JS inline animation-delay targets */
.deal-grid .deal-tile--animate:nth-child(1) { animation-delay: 0.05s; }
.deal-grid .deal-tile--animate:nth-child(2) { animation-delay: 0.1s; }
.deal-grid .deal-tile--animate:nth-child(3) { animation-delay: 0.15s; }
.deal-grid .deal-tile--animate:nth-child(4) { animation-delay: 0.2s; }
.deal-grid .deal-tile--animate:nth-child(5) { animation-delay: 0.25s; }
.deal-grid .deal-tile--animate:nth-child(6) { animation-delay: 0.3s; }


/* ═══ 10. MOBILE REFINEMENTS ═══ */
@media (max-width: 768px) {
  .deal-tile__body {
    padding: var(--sp-4);
    gap: var(--sp-3);
  }

  .deal-tile__title {
    font-size: 1.2rem;
  }

  .deal-tile__price {
    font-size: 1.55rem;
  }

  .deal-tile__cta {
    padding: 11px 16px;
    font-size: 0.875rem;
  }

  .deal-tile__community {
    padding: var(--sp-3) var(--sp-4);
  }

  .filter-bar {
    padding: var(--sp-3) var(--sp-4);
    margin: 0 var(--sp-3) var(--sp-5);
  }

  .filter-bar__filters {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
  }

  .filter-group {
    width: 100%;
  }

  .filter-select,
  .price-input {
    width: 100%;
    min-width: 0;
  }

  .filter-group--price .price-range {
    width: 100%;
  }

  .filter-group--price .price-input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .filter-reset {
    width: 100%;
    justify-content: center;
  }

  .community-feed__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  .sort-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }

  .sort-tabs::-webkit-scrollbar {
    display: none;
  }

  .sort-tab {
    flex-shrink: 0;
  }

  .deal-tile__price-row {
    flex-wrap: wrap;
  }

  .deal-tile__cta {
    width: 100%;
    justify-content: center;
  }

  .deal-tile__meta-item--price-night {
    margin-left: 0;
    width: 100%;
    margin-top: 2px;
  }
}

@media (max-width: 480px) {
  .deal-tile__savings-badge {
    font-size: 0.85rem;
    padding: 5px 11px 4px;
    top: var(--sp-2);
    left: var(--sp-2);
  }

  .deal-tile__heat-badge {
    top: var(--sp-2);
    right: var(--sp-2);
    font-size: 0.8125rem;
  }

  .hero--community .hero__stats {
    gap: var(--sp-4);
  }

  .hero--community .hero__stat-num {
    font-size: 1.75rem;
  }
}


/* ═══ 11. REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .deal-tile.deal-tile--animate,
  .deal-skeleton__media {
    animation: none !important;
  }

  .deal-tile:hover {
    transform: none;
  }

  .deal-tile__cta:hover .cta-arrow {
    transform: none;
  }

  .deal-tile__savings-badge--hot {
    animation: none;
  }
}


/* ═══ 12. PRINT STYLES ═══ */
@media print {
  .filter-bar,
  .sort-tabs,
  .community-ticker-wrap,
  .deal-tile__community {
    display: none;
  }

  .deal-tile {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
