/* dealshourly.com — static styles */
:root {
  --brand: #e63946;
  --brand-dark: #b5111f;
  --bg: #ffffff;
  --bg-soft: #f7f7fa;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --success: #10b981;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
  --container: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container {
  display: flex; align-items: center; gap: 24px;
  height: 80px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 60px; width: auto; }
.nav { display: flex; gap: 20px; margin-left: auto; font-weight: 500; }
.nav a { color: var(--text); }
.nav a:hover { color: var(--brand); text-decoration: none; }
.search-box {
  flex: 1; max-width: 420px;
  display: flex; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
}
.search-box input {
  border: 0; background: transparent; outline: 0;
  flex: 1; padding: 6px; font-size: 15px; color: var(--text);
}
.search-box button {
  border: 0; background: var(--brand); color: #fff;
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  font-weight: 600;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8ea 100%);
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 36px; margin: 0 0 8px; color: var(--brand-dark); }
.hero p { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
.hero-search {
  display: flex; max-width: 640px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; box-shadow: var(--shadow);
}
.hero-search input { flex: 1; border: 0; padding: 14px 22px; font-size: 16px; outline: 0; }
.hero-search button { border: 0; background: var(--brand); color: #fff; padding: 0 28px; font-weight: 600; cursor: pointer; font-size: 16px; }

/* Section */
.section { padding: 40px 0; }
.section h2 { font-size: 24px; margin: 0 0 20px; }
.section-sub { color: var(--muted); margin: -12px 0 24px; }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-deals { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-stores { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Deal card */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .thumb {
  height: 140px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card .thumb img { max-height: 100%; object-fit: contain; padding: 12px; }
.card .thumb.placeholder { font-size: 22px; color: var(--muted); font-weight: 700; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .store { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.card .title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.8em;
}
.card .desc {
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .cta {
  margin-top: auto; padding-top: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.card .cta-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  min-height: 32px;
}
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-code { background: #fff4e5; color: #b45309; }
.badge-deal { background: #e0f2fe; color: #075985; }
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
  border: 0; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-block { display: block; width: 100%; }

/* Store card (small tile) */
.store-tile {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; color: var(--text); font-weight: 600;
  transition: border-color .15s ease;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.store-tile:hover { border-color: var(--brand); text-decoration: none; color: var(--brand); }
.store-tile .count { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.store-tile .tile-logo {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border-radius: 8px;
  overflow: hidden; font-size: 18px; color: var(--muted); font-weight: 700;
}
.store-tile .tile-logo img { max-width: 48px; max-height: 48px; object-fit: contain; }
.store-tile .tile-logo.placeholder { background: var(--bg-soft); color: var(--muted); }

/* Store page header logo */
.store-head-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.store-logo {
  width: 88px; height: 88px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 28px; font-weight: 700; color: var(--muted);
}
.store-logo img { max-width: 72px; max-height: 72px; object-fit: contain; }
.store-logo.placeholder { background: var(--bg-soft); }

/* Placeholder thumb (when no image AND Clearbit fails) */
.thumb.placeholder {
  font-size: 22px; color: var(--muted); font-weight: 700;
  background: var(--bg-soft);
}

/* Category chip */
.cat-chip {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px; display: flex; flex-direction: column; gap: 4px;
  color: var(--text); font-weight: 600;
}
.cat-chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.cat-chip .count { color: var(--muted); font-weight: 400; font-size: 13px; }

/* Store header */
.store-header {
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  padding: 32px 0;
}
.store-header h1 { margin: 0 0 6px; font-size: 28px; }
.store-header .meta { color: var(--muted); }

/* Code reveal */
.code-reveal {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px dashed var(--brand); border-radius: 8px;
  overflow: hidden; font-family: ui-monospace, SFMono-Regular, monospace;
  background: #fff8f8;
  max-width: 100%;
}
.code-reveal .code-val {
  padding: 6px 10px; font-weight: 700; color: var(--brand-dark);
  letter-spacing: 1px; min-width: 60px; max-width: 120px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.code-reveal .copy-btn {
  border: 0; background: var(--brand); color: #fff; padding: 6px 12px;
  font-weight: 600; cursor: pointer; font-size: 13px;
  flex-shrink: 0;
  transition: background-color .2s ease;
}
.code-reveal .copy-btn:hover { background: var(--brand-dark); }
.code-reveal .copy-btn.copied { background: var(--success); }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-weight: 500;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Breadcrumbs */
.crumbs { padding: 16px 0; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

/* Footer */
.site-footer {
  background: #1f2937; color: #d1d5db; padding: 32px 0; margin-top: 60px;
  font-size: 14px;
}
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.site-footer h4 { margin: 0 0 10px; color: #fff; font-size: 15px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .copy { margin-top: 24px; border-top: 1px solid #374151; padding-top: 16px; color: #9ca3af; font-size: 13px; }

/* Utility */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.empty-state { padding: 48px 0; text-align: center; color: var(--muted); }

/* Search results page */
#results { margin-top: 24px; }
#search-status { color: var(--muted); margin: 12px 0 24px; }

/* Responsive */
@media (max-width: 720px) {
  .hero h1 { font-size: 28px; }
  .site-header .search-box { display: none; }
  .nav { gap: 12px; font-size: 14px; }
}
