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

/* Logo palette:
   Gold    #D4921A / #F0C040 (highlight)
   Red     #8B1A1A / #A52020
   Dark    #120608
   Cream   #F0E2C0
   Muted   #907060
*/
:root {
  --bg:       #120608;
  --card-bg:  #1E0C0E;
  --border:   #3D1A10;
  --accent:   #D4921A;
  --accent-hi:#F0C040;
  --red:      #8B1A1A;
  --text:     #F0E2C0;
  --muted:    #907060;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(18, 6, 8, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo img {
  height: 52px;
  width: auto;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-shadow: 0 0 20px rgba(212, 146, 26, 0.4);
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--accent);
}

/* Main */
main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 30px rgba(212, 146, 26, 0.35);
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0.5rem auto 0;
  line-height: 1.6;
}

/* Grid */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

/* Card */
.deal-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(212, 146, 26, 0.2);
  border-color: var(--accent);
}

.deal-card .img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deal-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s;
  padding: 1rem;
}

.deal-card:hover .img-wrap img {
  transform: scale(1.07);
}

.deal-card .card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deal-card .title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.deal-card .price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-hi);
}

.deal-card .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: auto;
}

.deal-card .get-deal {
  margin-top: 0.75rem;
  display: block;
  background: linear-gradient(135deg, var(--accent), #B07818);
  color: #1a0808;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s;
  width: 100%;
}

.deal-card .get-deal:hover {
  filter: brightness(1.15);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
}

.pagination button {
  background: var(--card-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: var(--accent);
  color: #1a0808;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

#page-info {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

footer nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

footer nav a:hover {
  color: var(--accent);
}

footer p {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Affiliate notice */
.affiliate-notice {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: rgba(30, 12, 14, 0.95);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  z-index: 100;
}

/* Loading state */
.deal-grid.loading {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.no-deals {
  color: var(--muted);
  text-align: center;
  padding: 3rem;
  grid-column: 1/-1;
}

/* Popup overlay */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.popup-overlay.open {
  display: flex;
}

.popup-box {
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  animation: popup-in 0.2s ease;
  text-align: center;
  box-shadow: 0 0 40px rgba(212, 146, 26, 0.2);
}

@keyframes popup-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.popup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.popup-close:hover { color: var(--text); }

.popup-flag {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.popup-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.popup-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-hi);
  margin-bottom: 0.75rem;
}

.popup-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.popup-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.popup-go {
  background: linear-gradient(135deg, var(--accent), #B07818);
  color: #1a0808;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.2s;
}

.popup-go:hover { filter: brightness(1.15); }

.popup-countdown-wrap {
  font-weight: 400;
  opacity: 0.75;
  font-size: 0.85rem;
}

.popup-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.popup-cancel:hover {
  border-color: var(--muted);
  color: var(--text);
}

.popup-affiliate {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.6;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .deal-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  header { padding: 0.5rem 1rem; }
  .logo img { height: 40px; }
  .popup-box { padding: 1.5rem; }
}
