/*
Theme Name: DealNest
Theme URI: https://example.com/
Author: Your Name
Description: Coupons & deals directory theme converted from a static HTML prototype.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dealnest
*/

:root {
  --brand: #ff6b35;
  --brand-dark: #e8551f;
  --brand-light: #fff1ea;
  --teal: #0d7d7d;
  --ink: #1b2029;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f7f9;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 20, 30, 0.06);
  --shadow-hover: 0 8px 24px rgba(20, 20, 30, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.top-bar {
  background: var(--ink);
  color: #cfd3da;
  font-size: 13px;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  padding-bottom: 6px;
}
.top-bar a:hover { color: #fff; }

header.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo span { color: var(--brand); }

nav.main-nav {
  display: flex;
  gap: 22px;
  flex: 1;
}
nav.main-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  padding: 8px 0;
}
nav.main-nav a:hover, nav.main-nav a.active { color: var(--brand); }

.header-search {
  flex: 1;
  max-width: 340px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
}
.header-search input:focus { outline: 2px solid var(--brand); }
.header-search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; border: 1.5px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1b2029 0%, #2c3444 100%);
  color: #fff;
  padding: 56px 0 64px;
  text-align: center;
}
.hero h1 { font-size: 38px; margin: 0 0 12px; }
.hero p { color: #cfd3da; font-size: 16px; margin: 0 0 28px; }
.hero-search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: 16px 18px;
  font-size: 15px;
}
.hero-search input:focus { outline: none; }
.hero-search button {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 0 26px;
  font-weight: 700;
  cursor: pointer;
}
.hero-search button:hover { background: var(--brand-dark); }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 22px; color: var(--brand); }
.hero-stats span { font-size: 13px; color: #cfd3da; }

/* ---------- Sections ---------- */
section.section { padding: 48px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-head h2 { font-size: 24px; margin: 0; }
.section-head a.view-all { font-size: 14px; font-weight: 700; color: var(--brand); }

/* ---------- Popular stores ---------- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.store-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 10px;
  text-align: center;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.store-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.store-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}
.store-tile .s-name { font-weight: 700; font-size: 14px; }
.store-tile .s-count { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Filter tabs ---------- */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filter-tabs button {
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.filter-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-tabs button:hover:not(.active) { border-color: var(--ink); }

/* ---------- Offer cards ---------- */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.offer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s ease;
}
.offer-card:hover { box-shadow: var(--shadow-hover); }
.offer-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.offer-top .s-name { font-weight: 700; font-size: 15px; }
.discount-badge {
  align-self: flex-start;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
}
.offer-title { font-size: 14.5px; color: var(--ink); min-height: 42px; }
.offer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
.stars { color: #f5a524; letter-spacing: 1px; }
.offer-actions { margin-top: 6px; }
.offer-actions .btn { width: 100%; text-align: center; }

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.category-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.category-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.category-tile .icon { font-size: 28px; }
.category-tile .c-name { font-weight: 700; font-size: 14.5px; }
.category-tile .c-count { color: var(--muted); font-size: 12px; }

/* ---------- Trending ---------- */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.trend-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.trend-thumb {
  height: 130px;
  background: linear-gradient(135deg, var(--teal), #16a3a3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
.trend-body { padding: 14px 16px; }
.trend-body .t-store { color: var(--muted); font-size: 12px; }
.trend-body .t-name { font-weight: 700; font-size: 14.5px; margin: 4px 0 8px; }
.trend-price { display: flex; align-items: baseline; gap: 8px; }
.trend-price .now { font-weight: 800; color: var(--teal); font-size: 16px; }
.trend-price .old { text-decoration: line-through; color: var(--muted); font-size: 13px; }
.trend-updated { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Guides ---------- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.guide-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-card h3 { margin: 0 0 8px; font-size: 16px; }
.guide-card p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.guide-card .author { font-size: 12px; color: var(--brand-dark); font-weight: 700; }

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.newsletter h2 { margin: 0 0 6px; font-size: 22px; }
.newsletter p { margin: 0; color: #ffe8dc; font-size: 14px; }
.newsletter form { display: flex; gap: 8px; }
.newsletter input {
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  width: 260px;
  font-size: 14px;
}
.newsletter .btn { background: var(--ink); color: #fff; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #b6bac3;
  padding: 48px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}
.footer-grid h4 { color: #fff; font-size: 14px; margin: 0 0 14px; }
.footer-grid li { margin-bottom: 8px; font-size: 13.5px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #333a47;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}
.socials { display: flex; gap: 12px; }
.socials a {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #2c3444;
  display: flex; align-items: center; justify-content: center;
}
.socials a:hover { background: var(--brand); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 24, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  width: 380px;
  max-width: 92vw;
  padding: 26px;
  text-align: center;
  position: relative;
}
.modal-box .close-btn {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted);
}
.modal-store-badge {
  width: 56px; height: 56px; border-radius: 50%;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 18px;
}
.modal-box h3 { margin: 0 0 6px; font-size: 17px; }
.modal-box .modal-discount { color: var(--brand); font-weight: 800; margin-bottom: 14px; }
.code-box {
  border: 2px dashed var(--brand);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--brand-light);
  margin-bottom: 14px;
}
.code-box span { font-weight: 800; letter-spacing: 1px; font-size: 15px; }
.modal-box .go-btn { width: 100%; }
.modal-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ---------- Page header (store/category pages) ---------- */
.page-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 30px 0;
}
.page-header-inner { display: flex; align-items: center; gap: 18px; }
.page-header h1 { margin: 0; font-size: 26px; }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--brand); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .store-grid { grid-template-columns: repeat(3, 1fr); }
  .offer-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .trending-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  nav.main-nav { display: none; }
}
@media (max-width: 600px) {
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .offer-grid { grid-template-columns: 1fr; }
  .trending-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .newsletter { flex-direction: column; align-items: flex-start; }
  .newsletter input { width: 100%; }
  .newsletter form { width: 100%; }
}
