/* ============================================
   GabayPH — Design System & Styles
   Mobile-first, accessible, performance-focused
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --text: #1E293B;
  --text-muted: #596981;
  --primary: #1D4ED8;
  --primary-hover: #1E40AF;
  --primary-light: #DBEAFE;
  --accent: #D97706;
  --accent-hover: #B45309;
  --border: #E2E8F0;
  --success: #16A34A;
  --step-bg: #F0F9FF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --content-max: 760px;
  --page-max: 1200px;
  --sidebar-w: 300px;
  --header-h: 60px;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg: #0F172A;
  --bg-subtle: #1E293B;
  --text: #E2E8F0;
  --text-muted: #94A3B8;
  --primary: #60A5FA;
  --primary-hover: #93BBFD;
  --primary-light: #1E3A5F;
  --accent: #FBBF24;
  --accent-hover: #F59E0B;
  --border: #334155;
  --success: #4ADE80;
  --step-bg: #1E293B;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}
[data-theme="dark"] .pro-tips { background: #422006; border-color: #92400E; }
[data-theme="dark"] .cookie-banner { background: #020617; }
[data-theme="dark"] .notice-box { background: #431407 !important; border-color: #92400E !important; color: var(--text) !important; }
[data-theme="dark"] .notice-box strong { color: var(--accent) !important; }

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.3; color: var(--text); }
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.375rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
strong { font-weight: 600; }

/* Article section spacing */
.content-main > section + section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* --- Layout --- */
.page-wrapper {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 16px;
}

.content-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.content-main {
  flex: 1;
  max-width: var(--content-max);
  min-width: 0;
}

.content-sidebar {
  display: none; /* hidden on mobile */
  width: var(--sidebar-w);
  flex-shrink: 0;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  overflow: visible;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; color: var(--primary-hover); }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

/* --- Navigation --- */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--bg-subtle); }
.nav-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.main-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 99;
}
.main-nav.is-open { display: block; }

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-list a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.15s;
}
.nav-list a:hover { background: var(--bg-subtle); text-decoration: none; }
.nav-list a.active { background: var(--primary-light); color: var(--primary); }

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 12px 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.breadcrumbs li::after {
  content: "›";
  margin-left: 4px;
  color: var(--border);
}
.breadcrumbs li:last-child::after { content: none; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* --- Article Header --- */
.article-header { margin-bottom: 1.5rem; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.article-meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }

.article-category {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}

/* --- Share Buttons --- */
.share-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.share-btn:hover { background: var(--bg-subtle); border-color: var(--text-muted); text-decoration: none; }
.share-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.share-btn svg { width: 16px; height: 16px; }
.share-btn--fb { color: #1877F2; }
.share-btn--messenger { color: #0084FF; }

/* --- Quick Summary Box --- */
.summary-box {
  background: var(--step-bg);
  border: 1px solid var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 1.5rem;
}
.summary-box h2 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--primary);
}
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.summary-item {
  font-size: 0.875rem;
}
.summary-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Table of Contents --- */
.toc {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.toc summary {
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.toc[open] summary::after { content: "−"; }
.toc-list {
  list-style: none;
  padding: 0 16px 12px;
}
.toc-list li { padding: 4px 0; }
.toc-list a {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.toc-list a:hover { color: var(--primary); }

/* --- Steps --- */
.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 20px 0 20px 64px;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 20px;
  width: 44px;
  height: 44px;
  background: var(--step-bg);
  border: 2px solid var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
}

.step h3 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.step p { margin-bottom: 0.75rem; }
.step p:last-child { margin-bottom: 0; }

.step ul, .step ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}
.step li { margin-bottom: 0.25rem; }

/* --- Requirements / Checklist --- */
.requirements {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 1.5rem;
}
.requirements h2 {
  font-size: 1.0625rem;
  margin-top: 0;
  margin-bottom: 8px;
}
.checklist {
  list-style: none;
  padding: 0;
}
.checklist li {
  padding: 6px 0 6px 28px;
  position: relative;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* --- Pro Tips --- */
.pro-tips {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 2rem 0;
}
.pro-tips h2 {
  font-size: 1.0625rem;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--accent);
}
.pro-tips ul {
  padding-left: 1.25rem;
  margin: 0;
}
.pro-tips li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

/* --- FAQ Section --- */
.faq-section { margin: 2rem 0; }
.faq-section h2 { margin-bottom: 1rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-answer {
  padding: 12px 16px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* --- Ad Slots --- */
.ad-slot {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1.5rem 0;
  min-height: 250px;
}
.ad-slot--sidebar {
  min-height: 600px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.ad-slot--leaderboard {
  min-height: 50px;
  margin: 0 0 8px;
}

/* --- Related Guides --- */
.related-guides { margin: 2rem 0; }
.related-guides h2 { margin-bottom: 1rem; }

.guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.guide-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-light);
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  background: var(--bg);
}
.guide-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); border-left-color: var(--primary); text-decoration: none; transform: translateY(-2px); }
.guide-card h3 {
  font-size: 0.9375rem;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.35;
}
.guide-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}
.guide-card .card-category {
  font-size: 0.625rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  display: inline-block;
}

/* --- Feedback Bar --- */
.feedback-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.feedback-bar a { font-weight: 500; }
.feedback-buttons { display: flex; gap: 8px; }
.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.feedback-btn:hover { background: var(--bg-subtle); border-color: var(--text-muted); }
.feedback-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.feedback-btn--yes:hover { border-color: var(--success); color: var(--success); }
.feedback-btn--no:hover { border-color: #EF4444; color: #EF4444; }
.feedback-thanks { font-size: 0.875rem; color: var(--success); }
.feedback-thanks[hidden] { display: none; }
.feedback-detail-link { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--primary); }

/* --- Footer --- */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 40px 16px 24px;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-section h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.footer-section ul { list-style: none; }
.footer-section li { padding: 6px 0; }
.footer-section a { color: var(--text); font-size: 0.875rem; }
.footer-section a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-legal a { padding: 4px 0; }
.footer-legal a { color: var(--text-muted); }

/* --- Homepage --- */
.hero {
  text-align: center;
  padding: 36px 16px 32px;
  background: linear-gradient(160deg, #EFF6FF 0%, #DBEAFE 40%, #E0E7FF 100%);
  border-radius: 12px;
  margin: 12px 0 20px;
}
[data-theme="dark"] .hero {
  background: linear-gradient(160deg, #1E293B 0%, #1E3A5F 40%, #312E81 100%);
}
.hero h1 {
  font-size: 1.75rem;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  color: var(--text);
  background: var(--bg);
}
.category-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); text-decoration: none; transform: translateY(-2px); }

.category-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  overflow: hidden;
}
.category-icon img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; }
/* Deals card highlight */
.category-card--deals { border-color: var(--accent); background: linear-gradient(135deg, #FFFBEB, #FEF3C7); }
[data-theme="dark"] .category-card--deals { background: linear-gradient(135deg, #422006, #78350F); border-color: #92400E; }

.category-card h3 {
  font-size: 0.8125rem;
  margin: 0;
  font-weight: 600;
}
.category-card span {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.section-title {
  font-size: 1.125rem;
  margin-bottom: 0.875rem;
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}
.section-title:first-of-type { margin-top: 0; }

/* --- Category Page --- */
.category-header {
  padding: 24px 0;
  margin-bottom: 1rem;
}
.category-header h1 { margin-bottom: 4px; }
.category-header p { color: var(--text-muted); font-size: 0.9375rem; }

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-list-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
  color: var(--text);
  align-items: flex-start;
}
.guide-list-item:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.guide-list-item:nth-child(even) { background: var(--bg-subtle); }

.guide-list-item .guide-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--step-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  font-size: 0.875rem;
}
.guide-list-item h3 { font-size: 1rem; margin: 0 0 2px; }
.guide-list-item p { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

/* --- Cookie Consent --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--text);
  color: #fff;
  padding: 16px;
  z-index: 200;
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  font-size: 0.8125rem;
}
.cookie-inner a { color: var(--primary-light); }
.cookie-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 20px;
  width: 100%;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.8125rem;
}
.cookie-btn:hover { background: var(--primary-hover); }
.cookie-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cookie-btns { display: flex; gap: 8px; width: 100%; }
.cookie-btn--decline { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; }
.cookie-btn--decline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

/* --- Print Styles --- */
@media print {
  .site-header, .main-nav, .ad-slot, .share-bar, .cookie-banner, .search-panel,
  .content-sidebar, .site-footer, .related-guides, .feedback-bar, .back-to-category,
  .print-checklist-btn, .theme-toggle, .search-toggle { display: none !important; }
  .content-main { max-width: 100%; }
  body { font-size: 12pt; line-height: 1.5; color: #000; }
  a { color: #000; text-decoration: underline; }
  .step { padding-left: 40px; }
  .step::before { width: 30px; height: 30px; font-size: 14pt; border: 1px solid #000; }
  .summary-box, .requirements, .pro-tips { border: 1px solid #ccc; }
  /* Checklist-only print mode */
  body.printing-checklist .content-main > *:not(section),
  body.printing-checklist .breadcrumbs, body.printing-checklist .article-header,
  body.printing-checklist .summary-box, body.printing-checklist .toc,
  body.printing-checklist .steps-list, body.printing-checklist .pro-tips,
  body.printing-checklist .faq-section, body.printing-checklist .notice-box,
  body.printing-checklist section:not(#requirements) { display: none !important; }
  body.printing-checklist .requirements { border: 2px solid #000; padding: 24px; font-size: 14pt; }
  body.printing-checklist .checklist li { padding: 10px 0 10px 32px; font-size: 13pt; }
}

/* --- Tablet (640px+) --- */
@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  body { font-size: 1.0625rem; }

  .summary-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .guides-grid { grid-template-columns: 1fr 1fr; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  .hero h1 { font-size: 2.25rem; }
  .cookie-inner { flex-direction: row; text-align: left; justify-content: space-between; }
  .cookie-btn { width: auto; }
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
  h1 { font-size: 2.25rem; }
  body { font-size: 1.125rem; }

  .page-wrapper { padding: 0 24px; }

  /* Desktop nav */
  .nav-toggle { display: none; }
  .main-nav {
    display: flex;
    position: static;
    background: none;
    padding: 0;
    overflow: visible;
    margin-left: auto;
  }
  .nav-list {
    flex-direction: row;
    gap: 0;
    flex-wrap: nowrap;
  }
  .nav-list a {
    padding: 8px 10px;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .content-sidebar { display: block; }
  .guides-grid { grid-template-columns: 1fr 1fr 1fr; }
  .category-grid { grid-template-columns: repeat(6, 1fr); }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }

  .hero { padding: 48px 24px; }
  .hero h1 { font-size: 2.5rem; }
}

/* --- Theme Toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  margin-right: 4px;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-subtle); color: var(--text); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* --- Search --- */
.search-container { position: relative; max-width: 480px; margin: 20px auto 0; }
.search-input-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 2px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}
.search-results.is-visible { display: block; }
.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.is-active { background: var(--bg-subtle); text-decoration: none; }
.search-result-item h4 { font-size: 0.875rem; margin: 0 0 2px; font-weight: 600; }
.search-result-item p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.search-result-item .result-category {
  font-size: 0.6875rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
}
.search-no-results { padding: 16px; text-align: center; font-size: 0.875rem; color: var(--text-muted); }

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius);
  flex-shrink: 0;
  margin-right: 4px;
}
.search-toggle:hover { background: var(--bg-subtle); color: var(--text); }
.search-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.search-toggle svg { width: 20px; height: 20px; display: block; }

.search-panel {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: var(--header-h);
  z-index: 99;
}
.search-panel[hidden] { display: none; }
.search-panel-inner {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
}

/* --- Print Checklist Button --- */
.print-checklist-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  min-height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s;
}
.print-checklist-btn:hover { background: var(--primary-light); }
.print-checklist-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.print-checklist-btn svg { display: inline; width: 16px; height: 16px; flex-shrink: 0; }

/* --- Calculator --- */
.calc-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; }
.calc-tab {
  flex: 1;
  padding: 12px 10px;
  text-align: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}
.calc-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.calc-tab:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.calc-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.calc-tab:hover:not(.active) { background: var(--border); }
.calc-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.calc-container { max-width: 500px; }
.calc-panel[hidden] { display: none; }
.calc-field { margin-bottom: 16px; }
.calc-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}
.calc-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}
.calc-field input:focus { border-color: var(--primary); outline: none; }
.calc-compute-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  min-height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.calc-compute-btn:hover { background: var(--primary-hover); }
.calc-compute-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.calc-result {
  background: var(--step-bg);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
}
.calc-result[hidden] { display: none; }
.calc-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
}
.calc-result-item:last-child { border-bottom: none; }
.calc-result-item strong { color: var(--primary); font-size: 1.0625rem; }

/* --- Back to Category --- */
.back-to-category {
  display: inline-block;
  margin-top: 2rem;
  padding: 8px 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}
.back-to-category:hover { text-decoration: underline; }

/* --- Language Toggle --- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}
.lang-toggle button {
  background: none;
  border: none;
  padding: 8px 14px;
  min-height: 34px;
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.lang-toggle button::after { content: ''; position: absolute; top: -5px; bottom: -5px; left: -3px; right: -3px; }
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 100px; }
.lang-toggle button.active {
  background: var(--primary);
  color: #fff;
}

/* Guide images */
.guide-img {
  margin: 1.5rem 0;
  text-align: center;
}
.guide-img img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.guide-img figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.guide-img--svg img {
  border: none;
}
.guide-img--portal img {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Language visibility — exclude toggle buttons */
[data-lang="tl"]:not(.lang-toggle button) { display: none !important; }
body.lang-tl [data-lang="en"]:not(.lang-toggle button) { display: none !important; }
body.lang-tl [data-lang="tl"]:not(.lang-toggle button) { display: revert !important; }
.lang-toggle button { display: inline-block !important; }

/* For inline spans (within same paragraph) */
span[data-lang="tl"] { display: none; }
body.lang-tl span[data-lang="en"] { display: none; }
body.lang-tl span[data-lang="tl"] { display: inline; }

/* For figcaptions in guide images */
figcaption[data-lang="tl"] { display: none; }
body.lang-tl figcaption[data-lang="en"] { display: none; }
body.lang-tl figcaption[data-lang="tl"] { display: block; }

/* --- Deals Section --- */
.deal-filters { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--bg-subtle); border-radius: 10px; }
.filter-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 5px; font-family: var(--font-body); }
.filter-pills-scroll {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 4px;
}
.filter-pills-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .filter-pills-scroll { flex-wrap: wrap; overflow-x: visible; } }
.filter-pill {
  padding: 8px 16px; min-height: 44px; border: 1px solid var(--border); border-radius: 100px;
  background: var(--bg); color: var(--text); font-size: 0.8125rem; font-weight: 500;
  font-family: var(--font-body); cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.filter-pill:hover { background: var(--bg-subtle); border-color: var(--text-muted); }
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.deal-count { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1rem; }
.deal-updated { font-size: 0.75rem; color: var(--text-muted); margin: 4px 0 12px; letter-spacing: 0.02em; }

.deals-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .deals-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
@media (min-width: 1024px) { .deals-grid { grid-template-columns: 1fr 1fr 1fr; gap: 14px; } }

.deal-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  color: var(--text); display: flex; flex-direction: column; text-decoration: none; background: var(--bg);
  border-left: 3px solid var(--border);
}
.deal-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); border-color: var(--primary-light, #93C5FD); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.deal-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 8px; }
.deal-bank-badge {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.deal-bank--bpi { background: #FEE2E2; color: #DC2626; }
.deal-bank--metrobank { background: #DBEAFE; color: #1D4ED8; }
.deal-bank--eastwest { background: #FEF9C3; color: #854D0E; }
.deal-bank--securitybank { background: #D1FAE5; color: #065F46; }
.deal-bank--bdo { background: #EFF6FF; color: #1E40AF; }
.deal-bank--unionbank { background: #EDE9FE; color: #6D28D9; }
.deal-bank--hsbc { background: #FEE2E2; color: #B91C1C; }
.deal-bank--rcbc { background: #FEF3C7; color: #92400E; }
.deal-bank--chinabank { background: #FFEDD5; color: #C2410C; }
.deal-bank--pnb { background: #DBEAFE; color: #1E40AF; }
.deal-card[data-bank="bpi"] { border-left-color: #DC2626; }
.deal-card[data-bank="metrobank"] { border-left-color: #1D4ED8; }
.deal-card[data-bank="eastwest"] { border-left-color: #CA8A04; }
.deal-card[data-bank="bdo"] { border-left-color: #1E40AF; }
.deal-card[data-bank="unionbank"] { border-left-color: #7C3AED; }
.deal-card[data-bank="rcbc"] { border-left-color: #B45309; }
.deal-card[data-bank="hsbc"] { border-left-color: #DC2626; }
.deal-card[data-bank="securitybank"] { border-left-color: #059669; }
.deal-card[data-bank="chinabank"] { border-left-color: #EA580C; }
.deal-discount-badge { font-family: var(--font-heading); font-weight: 700; font-size: 0.875rem; color: #B45309; background: #FFFBEB; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
[data-theme="dark"] .deal-discount-badge { background: #78350F; color: #FDE68A; }
.deal-card h3 { font-size: 0.9375rem; margin: 0 0 4px; font-family: var(--font-heading); font-weight: 600; line-height: 1.35; color: var(--text); }
.deal-merchant { font-size: 0.8125rem; color: var(--text-muted); margin: 0; line-height: 1.4; }
.deal-expiry { font-size: 0.6875rem; color: var(--text-muted); margin: 3px 0 0; opacity: 0.7; }
.deal-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.75rem; color: var(--text-muted); }
.deal-badge {
  display: inline-block; font-size: 0.5625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 6px; border-radius: 3px; vertical-align: text-top; margin-left: 4px;
}
.deal-badge--new { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.deal-badge--ending { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
[data-theme="dark"] .deal-badge--new { background: #064E3B; color: #6EE7B7; border-color: #065F46; }
[data-theme="dark"] .deal-badge--ending { background: #7F1D1D; color: #FCA5A5; border-color: #991B1B; }

.deal-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 8px; }
.deal-tag { font-size: 0.6875rem; padding: 3px 8px; background: var(--bg-subtle); border-radius: 4px; color: var(--text-muted); line-height: 1.3; }
.deal-tag--code { background: #EFF6FF; color: #1D4ED8; font-weight: 600; border: 1px solid #BFDBFE; }
[data-theme="dark"] .deal-tag--code { background: #1E3A5F; color: #93C5FD; border-color: #1E3A5F; }

/* Dark mode overrides for deals */
[data-theme="dark"] .deal-bank--bpi { background: #7F1D1D; color: #FCA5A5; }
[data-theme="dark"] .deal-bank--metrobank { background: #1E3A5F; color: #93C5FD; }
[data-theme="dark"] .deal-bank--eastwest { background: #713F12; color: #FDE68A; }
[data-theme="dark"] .deal-bank--securitybank { background: #064E3B; color: #6EE7B7; }
[data-theme="dark"] .deal-bank--bdo { background: #1E3A8A; color: #93C5FD; }
[data-theme="dark"] .deal-bank--unionbank { background: #4C1D95; color: #C4B5FD; }
[data-theme="dark"] .deal-bank--hsbc { background: #7F1D1D; color: #FCA5A5; }
[data-theme="dark"] .deal-bank--rcbc { background: #78350F; color: #FDE68A; }
[data-theme="dark"] .deal-bank--chinabank { background: #7C2D12; color: #FDBA74; }

/* --- Deal Detail Page --- */
.deal-detail { max-width: var(--content-max); margin: 0 auto; }
.deal-detail-header { margin-bottom: 1.5rem; }
.deal-detail-badges { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.deal-detail h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 8px; }
@media (min-width: 640px) { .deal-detail h1 { font-size: 1.75rem; } }
.deal-detail-meta { font-size: 0.9375rem; color: var(--text-muted); margin: 0 0 4px; }
.deal-detail-verified { font-size: 0.75rem; color: var(--text-muted); margin: 0; opacity: 0.7; }

.deal-detail-info { margin-bottom: 2rem; }
.deal-detail-info h2 { font-size: 1.125rem; margin: 0 0 12px; }
.deal-detail-table { width: 100%; border-collapse: collapse; }
.deal-detail-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9375rem; vertical-align: top; }
.deal-detail-table td:first-child { color: var(--text-muted); white-space: nowrap; width: 40%; font-size: 0.8125rem; }
.deal-detail-discount { color: #B45309; }
[data-theme="dark"] .deal-detail-discount { color: #FDE68A; }
.deal-promo-code { background: #EFF6FF; color: #1D4ED8; padding: 3px 10px; border-radius: 4px; font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.04em; }
[data-theme="dark"] .deal-promo-code { background: #1E3A5F; color: #93C5FD; }

.deal-detail-redeem { margin-bottom: 2rem; }
.deal-detail-redeem h2 { font-size: 1.125rem; margin: 0 0 12px; }
.deal-detail-redeem ol { padding-left: 1.25rem; margin: 0; }
.deal-detail-redeem li { padding: 6px 0; line-height: 1.6; font-size: 0.9375rem; }
.deal-detail-redeem li + li { border-top: 1px solid var(--border); }

.deal-detail-cta { margin-bottom: 2rem; }
.deal-detail-cta .btn--primary {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 12px 24px; min-height: 44px;
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  font-size: 0.9375rem; font-weight: 600; font-family: var(--font-heading);
  text-decoration: none; transition: background 0.15s;
}
.deal-detail-cta .btn--primary:hover { background: var(--primary-hover); }
.deal-detail-cta .btn--primary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.deal-detail-similar { margin-bottom: 2rem; }
.deal-detail-similar h2 { font-size: 1.125rem; margin: 0; }

.deal-detail-disclaimer {
  margin-top: 2rem; padding: 14px 16px; background: var(--bg-subtle);
  border-radius: 8px; font-size: 0.75rem; color: var(--text-muted); line-height: 1.5;
}
.deal-detail-disclaimer a { color: var(--primary); }

/* --- Deals Hub: Bank Cards Grid --- */
.bank-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 2rem; }
@media (min-width: 640px) { .bank-cards-grid { grid-template-columns: 1fr 1fr 1fr; } }
.bank-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px 20px; border: none; border-radius: 12px;
  text-decoration: none; color: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
  min-height: 120px; position: relative; overflow: hidden;
}
.bank-card::after {
  content: "View deals \2192"; position: absolute; bottom: 10px;
  font-size: 0.6875rem; opacity: 0.7; letter-spacing: 0.03em;
}
.bank-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.15); transform: translateY(-3px); text-decoration: none; color: #fff; }
.bank-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bank-card-logo { height: 40px; max-width: 160px; object-fit: contain; filter: brightness(0) invert(1); }
.bank-card[data-bank="rcbc"] .bank-card-logo { height: 56px; }
.bank-card-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.125rem; letter-spacing: 0.01em; }
.bank-card-count { font-size: 0.875rem; opacity: 0.9; font-weight: 500; }
.bank-card[data-bank="bdo"] { background: linear-gradient(135deg, #1E40AF, #3B82F6); }
.bank-card[data-bank="bpi"] { background: linear-gradient(135deg, #B91C1C, #EF4444); }
.bank-card[data-bank="metrobank"] { background: linear-gradient(135deg, #1D4ED8, #60A5FA); }
.bank-card[data-bank="eastwest"] { background: linear-gradient(135deg, #92400E, #F59E0B); }
.bank-card[data-bank="rcbc"] { background: linear-gradient(135deg, #78350F, #D97706); }
.bank-card[data-bank="unionbank"] { background: linear-gradient(135deg, #5B21B6, #A78BFA); }
.bank-card[data-bank="hsbc"] { background: linear-gradient(135deg, #991B1B, #F87171); }
.bank-card[data-bank="securitybank"] { background: linear-gradient(135deg, #065F46, #34D399); }
.bank-card[data-bank="chinabank"] { background: linear-gradient(135deg, #9A3412, #FB923C); }
[data-theme="dark"] .bank-card { opacity: 0.92; }
[data-theme="dark"] .bank-card:hover { opacity: 1; }

.hub-section-header {
  font-size: 1.125rem; font-family: var(--font-heading); font-weight: 600;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
