/* ================================================================
   styles.css — Mineral Wells Deals
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS Custom Properties
   ---------------------------------------------------------------- */
:root {
  /* Brand colours */
  --color-primary:         #1e3a5f;
  --color-primary-mid:     #2563eb;
  --color-accent:          #f59e0b;
  --color-accent-dark:     #d97706;

  /* Dark mode palette (default) */
  --color-bg:              #0f172a;
  --color-surface:         #1e293b;
  --color-surface-2:       #273549;
  --color-border:          #334155;
  --color-text-primary:    #f1f5f9;
  --color-text-secondary:  #94a3b8;
  --color-text-placeholder:#475569;

  /* Shadows — more visible on dark backgrounds */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg:   0 10px 25px rgba(0,0,0,0.5);
  --shadow-xl:   0 20px 40px rgba(0,0,0,0.6);

  --font-family:           'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  --container-max:  1280px;
  --container-pad:  1.5rem;
  --card-min-width: 280px;
  --header-height:  72px;
}

/* ----------------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary-mid);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

select, input { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--color-text-primary); }
ul, ol { list-style: none; }

/* ----------------------------------------------------------------
   3. Utility
   ---------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-mid);
  border-color: var(--color-primary-mid);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--color-accent);
  color: #1a1a1a;
  border-color: var(--color-accent);
  font-weight: 700;
}
.btn-accent:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #1a1a1a;
  box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}

/* ----------------------------------------------------------------
   4. Container
   ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ----------------------------------------------------------------
   5. Site Header
   ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.72);
  font-weight: 400;
  line-height: 1.2;
}

/* ----------------------------------------------------------------
   6. Search Section
   ---------------------------------------------------------------- */
.search-section {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 0;
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

/* Search bar */
.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--color-text-placeholder);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0.75rem 3rem 0.75rem 3rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 1rem;
  color: var(--color-text-primary);
  background: var(--color-surface-2);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background-color var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.search-input::placeholder { color: var(--color-text-placeholder); }
.search-input:focus {
  outline: none;
  border-color: var(--color-primary-mid);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.2);
}
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 1rem;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-text-placeholder);
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
  line-height: 1;
  border: none;
  cursor: pointer;
}
.search-clear:hover { background: var(--color-text-secondary); }

/* Controls row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.sort-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.sort-select:focus {
  outline: none;
  border-color: var(--color-primary-mid);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}

.result-count {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}
.result-count strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* Category filter buttons */
.category-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.category-filters::-webkit-scrollbar { display: none; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-btn:hover {
  border-color: var(--color-primary-mid);
  color: #f1f5f9;
  background: rgba(37,99,235,0.15);
  transform: translateY(-1px);
}
.filter-btn.active {
  background: var(--color-primary-mid);
  border-color: var(--color-primary-mid);
  color: #fff;
  box-shadow: 0 3px 8px rgba(37,99,235,0.4);
}
.filter-btn.active:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.filter-btn-icon { font-size: 1em; line-height: 1; }

/* ----------------------------------------------------------------
   7. Deals Grid
   ---------------------------------------------------------------- */
.deals-section {
  padding: 2rem 0 4rem;
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
  gap: 1.5rem;
}

/* ----------------------------------------------------------------
   8. Deal Card
   ---------------------------------------------------------------- */
.deal-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
  animation: cardFadeIn 0.35s ease both;
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37,99,235,0.4);
}

/* Card image */
.card-img-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  flex-shrink: 0;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  transition: transform var(--transition-slow);
}
.deal-card:hover .card-img { transform: scale(1.04); }

.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #273549 100%);
  color: var(--color-text-placeholder);
}
.card-img-placeholder .placeholder-icon {
  font-size: 2.5rem;
  line-height: 1;
  opacity: 0.5;
}
.card-img-placeholder .placeholder-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.4;
}

/* Card body */
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-price {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #1a1a1a;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}

.card-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  flex: 1;
}

/* Card tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Tag color themes — adjusted for dark backgrounds */
.tag-lawn-care     { background: #14532d;  border-color: #166534;  color: #86efac; }
.tag-home          { background: #1e3a8a;  border-color: #1d4ed8;  color: #93c5fd; }
.tag-service       { background: #4c1d95;  border-color: #6d28d9;  color: #c4b5fd; }
.tag-kitchen       { background: #7c2d12;  border-color: #9a3412;  color: #fdba74; }
.tag-office-supply { background: #134e4a;  border-color: #0f766e;  color: #5eead4; }
.tag-auto          { background: #7f1d1d;  border-color: #991b1b;  color: #fca5a5; }
.tag-food          { background: #713f12;  border-color: #854d0e;  color: #fde047; }
.tag-health        { background: #831843;  border-color: #9d174d;  color: #f9a8d4; }
.tag-electronics   { background: #1e1b4b;  border-color: #3730a3;  color: #a5b4fc; }
.tag-real-estate   { background: #064e3b;  border-color: #065f46;  color: #6ee7b7; }
.tag-default       { background: #1e293b;  border-color: #334155;  color: #94a3b8; }
.tag-things-to-do { background: #1e1b4b; border-color: #4338ca; color: #a5b4fc; }
.tag-diy { background: #431407; border-color: #9a3412; color: #fb923c; }

/* Card actions */
.card-actions {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: rgba(15,23,42,0.3);
  flex-shrink: 0;
}

.card-view-btn {
  width: 100%;
  padding: 0.55rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
}
.card-view-btn:hover {
  background: var(--color-primary-mid);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

/* Featured card */
.deal-card.featured {
  border-color: var(--color-accent);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(245,158,11,0.2);
}
.deal-card.featured:hover {
  box-shadow: 0 12px 32px rgba(245,158,11,0.25);
}

.featured-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-accent);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245,158,11,0.5);
}

/* Card animation stagger */
.deal-card:nth-child(1)  { animation-delay: 0ms; }
.deal-card:nth-child(2)  { animation-delay: 50ms; }
.deal-card:nth-child(3)  { animation-delay: 100ms; }
.deal-card:nth-child(4)  { animation-delay: 150ms; }
.deal-card:nth-child(5)  { animation-delay: 200ms; }
.deal-card:nth-child(6)  { animation-delay: 250ms; }
.deal-card:nth-child(7)  { animation-delay: 300ms; }
.deal-card:nth-child(8)  { animation-delay: 350ms; }

/* ----------------------------------------------------------------
   9. No-Results
   ---------------------------------------------------------------- */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  gap: 1rem;
}
.no-results-icon { font-size: 4rem; line-height: 1; opacity: 0.3; }
.no-results-title { font-size: 1.5rem; color: var(--color-text-primary); }
.no-results-body {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 36ch;
}

/* ----------------------------------------------------------------
   10. Modal  ← KEY FIXES ARE HERE
   ---------------------------------------------------------------- */

/* Overlay covers the entire viewport */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15,23,42,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Use flex to center the modal panel */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlayFadeIn 0.2s ease both;
}

/* The white modal panel */
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

/* Close button — absolutely positioned in the top-right corner.
   No float, no sticky — those caused the layout bug. */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.modal-close:hover {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

/* Modal image */
.modal-img-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-img-wrapper img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  padding: 0.75rem;
  display: block;
}

/* Modal body */
.modal-body {
  padding: 1.75rem;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: 1.2;
  flex: 1;
  /* Make room for the absolute-positioned close button */
  padding-right: 2.5rem;
}

.modal-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-accent-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.modal-description {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.modal-contact {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.modal-contact-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.modal-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--color-text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.modal-contact-item:last-child { margin-bottom: 0; }
.modal-contact-item a {
  color: var(--color-primary-mid);
  font-weight: 600;
}
.modal-contact-item a:hover { color: var(--color-primary); }

.modal-date {
  font-size: 0.75rem;
  color: var(--color-text-placeholder);
  text-align: right;
  margin-top: 1rem;
}

.modal-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--color-accent);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}

/* ----------------------------------------------------------------
   11. Footer
   ---------------------------------------------------------------- */
.site-footer {
  background: #0a1628;
  color: rgba(255,255,255,0.6);
  padding: 2rem 0;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-size: 1.1rem;
}

.footer-copy {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
}
.footer-copy a { color: var(--color-accent); font-weight: 600; }
.footer-copy a:hover { color: var(--color-accent-dark); }

.footer-legal {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}
/* Header contact email (replaces Post a Deal button) */
.header-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.header-contact-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  white-space: nowrap;
}

.header-contact-email {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  
}



/* Hide label on very small screens to save space, keep email visible */
@media (max-width: 480px) {
  .header-contact-label {
    display: none;
  }

  .header-contact-email {
    font-size: 0.75rem;
  }
}
/* Footer email display (plain text, not a link) */
.footer-email {
  color: var(--color-accent);
  font-weight: 600;
}

/* ----------------------------------------------------------------
   12. Animations
   ---------------------------------------------------------------- */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------------------------------------------
   13. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --container-pad: 1rem;
    --header-height: 64px;
    --card-min-width: 240px;
  }
  .brand-name { font-size: 1.1rem; }
  .brand-tagline { display: none; }
  .controls-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 0.75rem;
    --card-min-width: 100%;
  }
  .search-input { font-size: 16px; } /* Prevents iOS zoom */
  .deals-grid { gap: 1rem; }

  /* On mobile, modal slides up from the bottom */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }
  .modal-img-wrapper {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

/* ----------------------------------------------------------------
   Header contact links row
   ---------------------------------------------------------------- */
.header-contact-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Facebook link in header */
.header-fb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.header-fb-link:hover {
  color: #93c5fd;
  text-decoration: none;
}

/* Divider dot between email and facebook link */
.header-contact-links .header-contact-email::after {
  content: '·';
  margin-left: 0.75rem;
  color: rgba(255,255,255,0.3);
  font-weight: 400;
}

/* ----------------------------------------------------------------
   Footer social row
   ---------------------------------------------------------------- */
.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

/* Facebook link in footer */
.footer-fb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid #1d4ed8;
  background: rgba(37,99,235,0.15);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast);
}
.footer-fb-link:hover {
  background: rgba(37,99,235,0.3);
  border-color: #3b82f6;
  color: #93c5fd;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ----------------------------------------------------------------
   Hide email text on very small screens, keep fb link visible
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .header-contact-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
  }

  .header-contact-links .header-contact-email::after {
    display: none;
  }

  .header-contact-email {
    display: none;
  }
}
/* ----------------------------------------------------------------
   Accent color card styles
   ---------------------------------------------------------------- */

/* Cards with an accent color get a subtle glow on hover
   matching their accent. The glow color comes from the inline
   border-top color via a CSS trick using box-shadow. */
.deal-card.accented:hover {
  /* The box shadow color is set dynamically via JS for each card.
     This rule just ensures the transition is smooth. */
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

/* Accented "View Deal" button hover state.
   The base style is set inline via JS.
   This rule handles the hover brightness increase. */
.card-view-btn.accented-btn:hover {
  filter: brightness(1.25);
  transform: translateY(-1px);
}

/* Make sure the accented price badge text does not get
   overridden by the default gradient background */
.card-price[style] {
  background-image: none;
}