*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f3f4f6;
  color: #0f172a;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 60%),
    #ffffff;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.logo span {
  color: #38bdf8;
}

.logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.logo-text {
  display: none;
}

.subtitle {
  font-size: 0.9rem;
  color: #6b7280;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.filters {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
}

.filters-toggle {
  cursor: pointer;
  user-select: none;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  padding: 0.55rem 0.85rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.filters-toggle-text {
  font-weight: 600;
}

.filters-toggle-hint {
  color: #6b7280;
  font-size: 0.8rem;
}

.filters.is-open .filters-toggle {
  border-color: rgba(59, 130, 246, 0.35);
}

.filters-panel {
  margin-top: 0.75rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  padding: 0.9rem;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.field {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.field input,
.field select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.85rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.field input::placeholder {
  color: #9ca3af;
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary {
  background: linear-gradient(to right, #0ea5e9, #6366f1);
  color: white;
}

.btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.content {
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.deal-card {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 60%),
    #ffffff;
  border-radius: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(59, 130, 246, 0.7);
}

.deal-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #e5e7eb;
}

.deal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #4b5563;
}

.pill-merchant {
  font-weight: 500;
  color: #111827;
}

.pill-badge {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.45);
  color: #166534;
}

.deal-title {
  font-size: 0.98rem;
  font-weight: 600;
}

.deal-description {
  font-size: 0.8rem;
  color: #6b7280;
  max-height: 3.5em;
  overflow: hidden;
}

.deal-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.deal-footer {
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  margin: 2rem 0 1rem;
  flex-wrap: wrap;
}

.page-link {
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0 0.5rem;
}

.page-link.active {
  background: linear-gradient(to right, #0ea5e9, #6366f1);
  border-color: transparent;
  color: #ffffff;
}

.page-info {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
}

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1rem 0 1.5rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  background: #ffffff;
}

.badge {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-hot {
  border-color: rgba(220, 38, 38, 0.7);
  color: #b91c1c;
  background: #fee2e2;
}

.badge-new {
  border-color: rgba(16, 185, 129, 0.7);
  color: #047857;
  background: #d1fae5;
}

.badge-ending {
  border-color: rgba(234, 179, 8, 0.8);
  color: #92400e;
  background: #fef3c7;
}

.layout-detail {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 2rem;
  margin-top: 1.5rem;
}

.hero-card {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 60%),
    #ffffff;
  border-radius: 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.hero-img-main {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: #e5e7eb;
  margin-bottom: 0.9rem;
}

.hero-img-main img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.hero-merchant {
  font-size: 0.9rem;
  color: #6b7280;
}

.hero-dates {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.hero-copy {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #1f2937;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.panel {
  background: #ffffff;
  border-radius: 1.1rem;
  padding: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.panel p {
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.thumb {
  border-radius: 0.4rem;
  overflow: hidden;
  background: #e5e7eb;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-title {
  margin-top: 2.5rem;
  font-size: 1rem;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.meta-list li {
  margin-bottom: 0.15rem;
}

.pill-row-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.status-chip {
  font-size: 0.75rem;
  color: #4f46e5;
}

.category-strip {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.category-strip-below {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.category-strip-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #4b5563;
}

.category-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.category-chip {
  font-size: 0.78rem;
}

.see-more-link {
  font-size: 0.78rem;
  color: #2563eb;
  text-decoration: none;
  padding-left: 0.4rem;
}

.see-more-link:hover {
  text-decoration: underline;
}

.categories-title {
  margin-top: 1rem;
  font-size: 1.3rem;
}

.category-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
}

.category-card {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.category-card:hover {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.category-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.category-count {
  font-size: 0.78rem;
  color: #6b7280;
}

@media (max-width: 900px) {
  .layout-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .actions .btn {
    flex: 1;
    justify-content: center;
  }

  .filters {
    width: 100%;
    max-width: 100%;
  }

  .filters-toggle {
    display: flex;
    width: 100%;
  }

  .filters:not(.is-open) .filters-panel {
    display: none;
  }

  .filters.is-open .filters-panel {
    display: block;
  }
}

@media (min-width: 641px) {
  .filters {
    display: block;
  }

  .filters-toggle {
    display: none;
  }

  .filters-panel {
    margin-top: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .filters-panel .search-bar {
    margin-top: 0;
    justify-content: flex-end;
  }
}

