:root {
  --brand: #ff6b00;
  --brand-hover: #e55e00;
  --brand-soft: #fff2e8;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #1b2432;
  --text-muted: #5e6a7c;
  --border: #e4e8ef;
  --green: #00a859;
  --green-soft: #e6f7ef;
  --blue: #0066cc;
  --shadow-sm: 0 2px 6px rgba(18, 28, 45, 0.05);
  --shadow-md: 0 8px 24px rgba(18, 28, 45, 0.1);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand strong {
  color: var(--brand);
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  font-size: 1.15rem;
}

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s, background 0.2s;
}

.search-form:focus-within {
  border-color: var(--brand);
  background: var(--surface);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}

.search-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.search-btn:hover {
  background: var(--brand-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.m51-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #066e3b;
  font-size: 0.82rem;
  font-weight: 600;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.2);
}

/* Subnav */
.subnav {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.subnav-inner {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 6px;
  padding-bottom: 6px;
}

.subnav-inner::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.nav-tab:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-tab.active {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Main */
.main-content {
  padding-top: 20px;
  padding-bottom: 48px;
}

/* Stores Strip */
.stores-strip {
  margin-bottom: 18px;
}

.stores-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.stores-scroll::-webkit-scrollbar {
  display: none;
}

.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.store-pill:hover {
  border-color: var(--brand);
}

.store-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.store-pill .count {
  opacity: 0.65;
  font-size: 0.76rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.results-count {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.price-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
}

.price-filter input {
  width: 78px;
  border: none;
  outline: none;
  font-size: 0.84rem;
  background: transparent;
  color: var(--text);
}

.btn-outline-sm {
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline-sm:hover {
  background: var(--brand);
  color: #fff;
}

.sort-select {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

/* Deals Grid */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.deal-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.deal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #ffd3b3;
}

.deal-thumb {
  position: relative;
  height: 190px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.deal-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.deal-heat {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(27, 36, 50, 0.85);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.deal-heat.hot {
  background: #ff4500;
}

.deal-time {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.deal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px;
  gap: 10px;
}

.deal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.store-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
}

.store-badge.amazon { background: #fff4e0; color: #b45309; }
.store-badge.meli { background: #fef9c3; color: #854d0e; }
.store-badge.shopee { background: #ffedd5; color: #c2410c; }
.store-badge.magalu { background: #dbeafe; color: #1d4ed8; }
.store-badge.kabum { background: #ffedd5; color: #ea580c; }

.aff-ready {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--green);
}

.deal-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.65em;
  cursor: pointer;
}

.deal-title:hover {
  color: var(--brand);
}

.deal-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.deal-price {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.deal-price.free {
  color: var(--green);
  font-size: 1.1rem;
}

.deal-actions {
  display: flex;
  gap: 8px;
}

.btn-go {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-go:hover {
  background: var(--brand-hover);
}

.btn-go:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-detail {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-detail:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: var(--bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

.modal-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

.modal-img-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
}

.modal-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 8px 0 12px;
}

.stats-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  text-align: center;
}

.stats-box small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.stats-box strong {
  font-size: 0.95rem;
}

.aff-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--green-soft);
  border: 1px solid #bce8d1;
  font-size: 0.84rem;
}

.aff-link-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.aff-link-row input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #bce8d1;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fff;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 80;
}

.toast.show {
  opacity: 1;
}

.skeleton {
  height: 360px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #e9edf2 25%, #f4f6f9 50%, #e9edf2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
  }
  .search-form {
    order: 3;
    flex-basis: 100%;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
}


/* Header Nav Buttons */
.header-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.header-nav-btn:hover {
  background: var(--bg);
}

.header-nav-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.view-header {
  margin-bottom: 18px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* Wishlist */
.wishlist-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr auto;
  gap: 10px;
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.wishlist-form input,
.wishlist-form select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
}

.wishlist-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wishlist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.wishlist-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.wishlist-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.wl-mini-deal {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.wl-mini-deal img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}

/* Blog Grid (TechTudo style) */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.blog-card-cover {
  height: 190px;
  width: 100%;
  object-fit: cover;
  background: #e5e7eb;
}

.blog-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.blog-cat {
  display: inline-block;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.blog-card-title {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.blog-card-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  margin-top: auto;
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Article Reader (TechTudo style) */
.article-reader {
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.article-breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.article-subtitle {
  font-size: 1.12rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.article-meta {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 24px;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #253041;
}

.article-content h2 {
  font-size: 1.38rem;
  font-weight: 800;
  margin: 24px 0 10px;
  color: var(--text);
}

.article-content p {
  margin-bottom: 14px;
}

.article-content ul {
  margin: 12px 0 18px 22px;
}

.article-content li {
  margin-bottom: 6px;
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.pros, .cons {
  padding: 16px;
  border-radius: 12px;
}

.pros {
  background: var(--green-soft);
  border: 1px solid #bce8d1;
}

.cons {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.pros h4 { color: #066e3b; margin-bottom: 8px; }
.cons h4 { color: #c2410c; margin-bottom: 8px; }

.article-deal-box {
  margin-top: 26px;
  padding: 18px;
  border-radius: 14px;
  border: 2px solid var(--brand);
  background: var(--brand-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.article-deal-box img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}

@media (max-width: 860px) {
  .wishlist-form {
    grid-template-columns: 1fr;
  }
  .pros-cons {
    grid-template-columns: 1fr;
  }
  .article-reader {
    padding: 20px;
  }
  .article-title {
    font-size: 1.5rem;
  }
}


/* Feedback buttons & Offline status */
.deal-feedback-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.btn-fb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-fb:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-fb-warn {
  margin-left: auto;
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.btn-fb-warn:hover {
  background: #fef3c7;
  color: #92400e;
}

.offline-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(185, 28, 28, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.deal-card.deal-offline {
  opacity: 0.65;
}


.coupon-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed #f97316;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.coupon-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed #f97316;
  background: #fff7ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  color: #9a3412;
}


.blog-coupon-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  margin: 0 2px;
  border-radius: 6px;
  border: 1.5px dashed #ea580c;
  background: #ffedd5;
  color: #9a3412;
  font-weight: 800;
  font-size: 0.92em;
  cursor: pointer;
}

.blog-coupon-tag:hover {
  background: #fed7aa;
}
