/* ============================================
   HATLOCK HOLMES - Fitted Hat Deal Aggregator
   Detective-themed design system
   ============================================ */

:root {
  --brown-900: #1a0f09;
  --brown-800: #2c1810;
  --brown-700: #3d2317;
  --brown-600: #5a3825;
  --gold-500: #d4a853;
  --gold-400: #e4bf6a;
  --gold-300: #f0d48a;
  --cream-100: #faf6ee;
  --cream-200: #f5f0e8;
  --cream-300: #ebe4d4;
  --white: #ffffff;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --green-600: #16a34a;
  --green-700: #15803d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--cream-100);
  color: var(--gray-700);
  line-height: 1.6;
}

/* ---- HEADER ---- */
.site-header {
  background: linear-gradient(135deg, var(--brown-800), var(--brown-700));
  color: var(--cream-100);
  padding: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  flex-shrink: 0;
}

.logo-icon img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.logo-text h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6em;
  color: var(--gold-400);
  letter-spacing: 1px;
  line-height: 1.1;
}

.logo-text .tagline {
  font-size: 0.75em;
  color: var(--cream-300);
  font-style: italic;
  opacity: 0.85;
}

.header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header-nav a {
  color: var(--cream-300);
  text-decoration: none;
  font-size: 0.9em;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

.header-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--gold-400);
}

.header-nav a.active {
  background: var(--gold-500);
  color: var(--brown-900);
  font-weight: 600;
}

/* ---- FIND MY SIZE BUTTON ---- */
/* Desktop header button — hidden on mobile */
.header-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--gray-700);
  border: 2px solid var(--cream-300);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
  position: static;
  width: auto;
  height: auto;
}

.header-filter-btn:hover {
  border-color: var(--gold-500);
  color: var(--brown-800);
  animation: none;
}

@media (max-width: 768px) {
  .header-filter-btn { display: none; }
}

/* FAB — hidden on desktop */
.filter-deals-btn {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 200;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--gold-500);
  color: var(--brown-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 12px rgba(212,175,55,0.4);
  transition: all 0.25s ease;
  animation: pulse-glow 2.5s ease-in-out infinite;
}

.filter-deals-btn:hover {
  background: var(--gold-400);
  transform: scale(1.08);
  animation: none;
}

@media (min-width: 769px) {
  .filter-deals-btn { display: none; }

  .sticky-top-desktop {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .site-header {
    position: relative;
  }

  .filter-section {
    position: relative;
    top: auto;
    box-shadow: none;
  }
}

.filter-deals-icon {
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0%, 100% { background: var(--gold-500); }
  50%       { background: var(--gold-400); }
}

.header-nav .social-link {
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 50%;
}

.header-nav .social-link:hover {
  background: rgba(255,255,255,0.15);
  color: var(--gold-400);
}

/* ---- SHARED DEAL BANNER ---- */
.shared-deal-banner {
  background: var(--gold-300);
  color: var(--brown-800);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.85em;
  font-weight: 600;
}

.shared-deal-all {
  background: var(--brown-700);
  color: var(--cream-100);
  border: none;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s;
}

.shared-deal-all:hover {
  background: var(--brown-800);
}

/* ---- STATS BAR ---- */
.stats-bar {
  background: var(--brown-900);
  padding: 8px 24px;
  text-align: center;
  font-size: 0.85em;
  color: var(--gold-300);
}

.stats-bar span {
  margin: 0 12px;
  white-space: nowrap;
}

.stats-bar .count {
  font-weight: 700;
  color: var(--gold-400);
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}

/* ---- PRICE INFO TOOLTIP ---- */
.price-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.price-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-500);
  background: none;
  color: var(--gray-500);
  font-size: 0.72em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.price-info-btn:hover,
.price-info-btn:focus {
  border-color: var(--brown-700);
  color: var(--brown-700);
  outline: none;
}

.price-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(260px, calc(100vw - 48px));
  background: var(--brown-900);
  color: var(--cream-300);
  font-size: 0.78em;
  line-height: 1.5;
  padding: 10px 13px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 300;
  pointer-events: none;
}

.price-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 9px;
  border: 6px solid transparent;
  border-bottom-color: var(--brown-900);
}

/* Watchlist ⓘ sits right-of-center — right-align tooltip so it opens leftward */
.price-tooltip--centered {
  left: auto;
  right: 0;
  transform: none;
}

.price-tooltip--centered::before {
  left: auto;
  right: 9px;
  transform: none;
}

.price-info-wrap:hover .price-tooltip,
.price-info-btn:focus + .price-tooltip,
.price-info-wrap.open .price-tooltip {
  display: block;
}

/* ---- FILTER BAR ---- */
.filter-section {
  background: var(--white);
  border-bottom: 2px solid var(--cream-300);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: 0.5px;
}

.store-select {
  padding: 8px 14px;
  border: 2px solid var(--cream-300);
  border-radius: 8px;
  font-size: 0.85em;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  min-width: 120px;
}

.store-select {
  min-width: 180px;
}

.store-select:focus {
  outline: none;
  border-color: var(--gold-500);
}

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

.price-range-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border-radius: 12px;
  padding: 0 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 1.5px var(--cream-300);
  transition: box-shadow 0.2s;
}

.price-range-pill:focus-within {
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 2px var(--gold-500);
}

.price-range-symbol {
  font-size: 0.8em;
  color: var(--gray-400);
  font-weight: 600;
  user-select: none;
}

.price-range-input {
  width: 52px;
  padding: 9px 2px;
  border: none;
  background: transparent;
  font-size: 0.85em;
  color: var(--gray-700);
  text-align: center;
}

.price-range-input:focus {
  outline: none;
}

.price-range-input::placeholder {
  color: var(--gray-400);
}

.price-range-dash {
  font-size: 0.9em;
  color: var(--gray-400);
  user-select: none;
}

.price-range-go {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--brown-700);
  color: var(--gold-400);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.price-range-go:hover {
  background: var(--brown-800);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;
  flex-grow: 1;
  max-width: 320px;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--gray-500);
  pointer-events: none;
  flex-shrink: 0;
}

.search-box {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: none;
  border-radius: 12px;
  font-size: 0.85em;
  background: var(--white);
  color: var(--gray-700);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 1.5px var(--cream-300);
  transition: box-shadow 0.2s;
}

.search-box:focus {
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 2px var(--gold-500);
}

.search-box::placeholder {
  color: var(--gray-400);
}

/* Active Filters Bar (shown after Find My Size is used) */
.active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-100);
  border: 2px solid var(--gold-500);
  border-radius: 10px;
  padding: 6px 10px;
  flex-wrap: wrap;
}

.active-filters-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.active-filters-label {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  margin-left: 2px;
}

.active-filter-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.78em;
  font-weight: 700;
  background: var(--brown-700);
  color: var(--gold-400);
}

.active-filter-tag--league {
  background: var(--gold-500);
  color: var(--brown-900);
}

.active-filters-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px solid var(--cream-300);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.76em;
  font-weight: 600;
  color: var(--brown-700);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  margin-left: auto;
}

.active-filters-edit:hover {
  border-color: var(--gold-500);
  background: var(--white);
}

.active-filters-clear {
  background: none;
  border: none;
  font-size: 1.2em;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.active-filters-clear:hover {
  color: var(--red-600);
}

.results-count {
  font-size: 0.85em;
  color: var(--gray-500);
  margin-left: auto;
}

.results-count .count {
  font-weight: 700;
  color: var(--brown-700);
}


/* ---- MAIN CONTENT ---- */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ---- HAT GRID ---- */
.hat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ---- HAT CARD ---- */
.hat-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cream-300);
}

.hat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.hat-card-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream-200);
}

.hat-card-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.hat-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hat-card:hover .hat-card-image img {
  transform: scale(1.05);
}

.hat-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--brown-700);
  color: var(--gold-400);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hat-card-league {
  background: rgba(0,0,0,0.7);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7em;
  font-weight: 700;
}

.hat-card-sale-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--red-600);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 700;
}

.hat-card-bottom-left {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.hat-card-new-badge {
  background: var(--green-600);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 700;
}

.hat-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hat-card-name {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hat-card-name a {
  color: inherit;
  text-decoration: none;
}

.hat-card-name a:hover {
  color: var(--brown-600);
}

.hat-card-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.size-tag {
  background: var(--cream-200);
  color: var(--gray-700);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 600;
}

.hat-card-pricing {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream-200);
  padding: 10px 14px;
  margin: 10px -14px -14px -14px;
  border-top: 2px solid var(--cream-300);
}

.sale-price {
  font-size: 1.4em;
  font-weight: 800;
  color: var(--red-700);
}

.original-price {
  font-size: 0.95em;
  color: var(--gray-500);
  text-decoration: line-through;
}

.savings-pct {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--green-600);
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ---- WATCHLIST BUTTON ---- */
.watchlist-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--cream-300);
  border: 2px solid rgba(255,255,255,0.25);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.watchlist-btn:hover {
  border-color: var(--gold-400);
  color: var(--gold-400);
}

.watchlist-btn.active {
  background: var(--brown-900);
  border-color: var(--gold-500);
  color: var(--gold-400);
}

.watchlist-btn.main-menu {
  background: var(--gold-500);
  color: var(--brown-900);
  border-color: var(--gold-500);
  font-weight: 700;
}

.watchlist-btn.main-menu:hover {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--brown-900);
  transform: scale(1.05);
}

.watchlist-btn .icon-back {
  display: none;
}

.watchlist-btn.main-menu .icon-heart,
.watchlist-btn.main-menu .watchlist-badge {
  display: none;
}

.watchlist-btn.main-menu .icon-back {
  display: block;
}

.watchlist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--red-600);
  color: var(--white);
  border-radius: 10px;
  font-size: 0.72em;
  font-weight: 700;
  padding: 0 4px;
  line-height: 1;
}

.watchlist-badge:empty {
  display: none;
}

/* ---- WATCHLIST BACK CONTROLS ---- */

/* Button inside the filter bar (hidden normally, shown in watchlist mode) */
.watchlist-filter-back {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--brown-700);
  background: var(--brown-700);
  color: var(--gold-400);
  border-radius: 8px;
  font-size: 0.88em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.watchlist-filter-back:hover {
  background: var(--brown-800);
  border-color: var(--brown-800);
}

.filter-inner.watchlist-mode .watchlist-filter-back {
  display: flex;
}

/* ---- WATCHLIST HEADING ---- */
.watchlist-disclaimer {
  display: none;
  padding: 16px 24px 8px;
}

.watchlist-disclaimer.visible {
  display: block;
}

.watchlist-heading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.watchlist-heading-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--brown-700);
}

.watchlist-sort-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.88em;
  color: var(--brown-600);
}

.hat-card-saved-date {
  font-size: 0.72em;
  color: var(--brown-400);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

.hat-card--ghost .hat-card-saved-date {
  color: var(--gray-500);
}

.stats-bar.hidden,
.filter-section.hidden {
  display: none;
}

.filter-inner.watchlist-mode .filter-group {
  display: none;
}

.filter-inner.watchlist-mode .filter-group--sort {
  display: flex;
}

.filter-inner.watchlist-mode .search-wrap {
  display: none;
}

/* ---- BOOKMARK BUTTON ---- */
.bookmark-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
  z-index: 2;
  padding: 0;
  flex-shrink: 0;
}

.bookmark-btn:hover {
  background: var(--white);
  color: var(--red-600);
  transform: scale(1.1);
}

.bookmark-btn.saved {
  background: var(--red-600);
  color: var(--white);
}

.bookmark-btn.saved:hover {
  background: var(--red-700);
  color: var(--white);
  transform: scale(1.1);
}

/* ---- SHARE BUTTON ---- */
.share-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 10px;
  background: none;
  border: 1px solid var(--cream-300);
  border-radius: 20px;
  font-size: 0.72em;
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  align-self: flex-start;
}

.share-btn:hover {
  background: var(--cream-200);
  color: var(--brown-600);
  border-color: var(--brown-600);
}

.share-btn.copied {
  color: var(--green-600);
  border-color: var(--green-600);
}

/* ---- GHOST CARD (expired deal) ---- */
.hat-card--ghost {
  opacity: 0.65;
  filter: grayscale(0.6);
}

.hat-card--ghost:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.hat-card--ghost:hover .hat-card-image img {
  transform: none;
}

.ghost-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,15,9,0.55);
  color: var(--cream-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: 700;
  text-align: center;
  padding: 10px;
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* ---- NO RESULTS ---- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.no-results .icon {
  font-size: 3em;
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 1.2em;
  margin-bottom: 8px;
  color: var(--gray-700);
}

/* ---- LOADING / SENTINEL ---- */
.sentinel {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
  font-size: 0.9em;
}

.sentinel .spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--cream-300);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- CASE OF THE DAY ---- */
/* Lives inside hat-grid as the first item, spans 2 columns on desktop */
.case-of-the-day {
  background: linear-gradient(135deg, var(--brown-800), var(--brown-700));
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  border: 1px solid var(--brown-600);
  min-height: 240px;
}

@media (min-width: 769px) {
  .case-of-the-day {
    grid-column: span 2;
  }
}

.case-image {
  width: 240px;
  flex-shrink: 0;
}

.case-image a {
  display: block;
  width: 100%;
  height: 100%;
}

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

.case-body {
  padding: 22px 26px;
  flex: 1;
  color: var(--cream-100);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.case-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.case-label {
  font-size: 0.68em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-400);
  background: rgba(0,0,0,0.3);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.case-score {
  display: flex;
  align-items: center;
  gap: 3px;
}

.case-score-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.case-score-pip.filled {
  background: var(--gold-500);
}

.case-date {
  font-size: 0.72em;
  color: var(--cream-300);
  opacity: 0.65;
  margin-left: auto;
  white-space: nowrap;
}

.case-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1em;
  color: var(--cream-100);
  line-height: 1.3;
  margin-bottom: 8px;
}

.case-name a {
  color: inherit;
  text-decoration: none;
}

.case-name a:hover {
  color: var(--gold-400);
}

.case-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.case-store {
  font-size: 0.78em;
  color: var(--cream-300);
  opacity: 0.75;
}

.case-league-badge {
  background: rgba(0,0,0,0.3);
  color: var(--gold-300);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.7em;
  font-weight: 700;
}

.case-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.case-size-tag {
  background: rgba(255,255,255,0.1);
  color: var(--cream-200);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 600;
}

.case-pricing {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.case-sale-price {
  font-size: 1.9em;
  font-weight: 800;
  color: var(--gold-400);
  line-height: 1;
}

.case-original-price {
  font-size: 0.95em;
  color: var(--cream-300);
  text-decoration: line-through;
  opacity: 0.55;
}

.case-savings {
  font-size: 0.85em;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74,222,128,0.15);
  padding: 4px 10px;
  border-radius: 5px;
}

.case-quote {
  font-style: italic;
  font-size: 0.82em;
  color: var(--cream-300);
  opacity: 0.8;
  border-left: 2px solid var(--gold-500);
  padding-left: 12px;
  margin-bottom: 18px;
  flex-grow: 1;
}

.case-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.case-view-btn {
  background: var(--gold-500);
  color: var(--brown-900);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88em;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
  white-space: nowrap;
}

.case-view-btn:hover {
  background: var(--gold-400);
}

.case-watchlist-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.25);
  color: var(--cream-300);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.case-watchlist-btn:hover {
  border-color: var(--gold-400);
  color: var(--gold-400);
}

.case-watchlist-btn.saved {
  border-color: var(--red-600);
  color: #f87171;
  background: rgba(220,38,38,0.12);
}

@media (max-width: 768px) {
  .case-of-the-day {
    flex-direction: column;
  }
  .case-image {
    width: 100%;
    height: 200px;
  }
  .case-body {
    padding: 16px 18px;
  }
  .case-sale-price {
    font-size: 1.5em;
  }
  .case-name {
    font-size: 1.05em;
  }
  .case-date {
    display: none;
  }
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--brown-800);
  color: var(--cream-300);
  padding: 30px 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1em;
  color: var(--gold-400);
}

.footer-links a {
  color: var(--cream-300);
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.85em;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold-400);
}

.footer-disclaimer {
  width: 100%;
  text-align: center;
  font-size: 0.8em;
  opacity: 0.7;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---- FIND MY SIZE MODAL ---- */
.filter-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 15, 9, 0.65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.filter-modal-overlay.open {
  display: flex;
}

.filter-modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modal-in 0.25s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 2px solid var(--cream-300);
}

.filter-modal-header h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.3em;
  color: var(--brown-700);
  margin: 0;
}

.filter-modal-close {
  background: none;
  border: none;
  font-size: 1.6em;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.filter-modal-close:hover {
  color: var(--red-600);
  background: rgba(220, 38, 38, 0.08);
}

.filter-modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
}

.filter-modal-section {
  margin-bottom: 20px;
}

.filter-modal-section:last-child {
  margin-bottom: 0;
}

.filter-modal-section h3 {
  font-size: 0.85em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brown-700);
  margin-bottom: 10px;
}

/* Size Checkboxes */
.size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.size-grid .size-check {
  display: flex;
}

.size-grid .size-check span {
  width: 100%;
  text-align: center;
}

.size-check,
.league-check {
  display: inline-flex;
  cursor: pointer;
}

.size-check input,
.league-check input {
  display: none;
}

.size-check span,
.league-check span {
  display: inline-block;
  padding: 6px 12px;
  border: 2px solid var(--cream-300);
  border-radius: 8px;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  transition: all 0.15s ease;
  user-select: none;
}

.size-check span:hover,
.league-check span:hover {
  border-color: var(--gold-500);
  color: var(--brown-700);
}

.size-check input:checked + span,
.league-check input:checked + span {
  background: var(--brown-700);
  color: var(--gold-400);
  border-color: var(--brown-700);
}

/* League Checkboxes */
.league-check-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modal Footer */
.filter-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 2px solid var(--cream-300);
}

.filter-modal-clear {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--cream-300);
  background: var(--white);
  color: var(--gray-700);
  border-radius: 10px;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-modal-clear:hover {
  border-color: var(--red-600);
  color: var(--red-600);
}

.filter-modal-apply {
  flex: 2;
  padding: 12px 16px;
  border: none;
  background: var(--gold-500);
  color: var(--brown-900);
  border-radius: 10px;
  font-size: 0.95em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-modal-apply:hover {
  background: var(--gold-400);
}

/* ---- BACK TO TOP BUTTON ---- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--cream-300);
  background: var(--white);
  color: var(--brown-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s, background 0.15s, border-color 0.15s;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--brown-700);
  border-color: var(--brown-700);
  color: var(--gold-400);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 12px 16px;
  }

  .logo-text h1 {
    font-size: 1.3em;
  }

  .filter-section {
    top: auto;
    position: relative;
  }

  .filter-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .active-filters {
    width: 100%;
  }

  .store-select,
  .search-wrap,
  .search-box {
    width: 100%;
    max-width: 100%;
  }

  .price-range {
    width: 100%;
    justify-content: center;
  }

  .price-range-pill {
    flex: 1;
  }

  .price-range-input {
    flex: 1;
    max-width: 100px;
  }

  .results-count {
    margin-left: 0;
    text-align: center;
  }

  .hat-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links a {
    margin: 0 10px;
  }

  .filter-modal {
    max-height: 85vh;
  }

  .filter-modal-body {
    padding: 16px 18px;
  }

}

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

  .league-btn {
    padding: 5px 10px;
    font-size: 0.75em;
  }
}
