@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display&display=swap');

/* =============================================
   CalcWise — style.css  v2
   ============================================= */

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

:root {
  --bg:            #F7F6F2;
  --surface:       #FFFFFF;
  --border:        #E4E2DA;
  --text:          #1A1916;
  --muted:         #6B6860;
  --accent:        #2A6B4F;
  --accent-light:  #EAF4EE;
  --accent-dark:   #1f5238;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow:        0 4px 20px rgba(0,0,0,.06);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.10);
  --font-body:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:  'DM Serif Display', Georgia, 'Times New Roman', serif;
  --nav-h:         58px;

  /* Category colors */
  --c-health:      #2A6B4F;
  --c-health-bg:   #EAF4EE;
  --c-finance:     #C84B2F;
  --c-finance-bg:  #FDF0ED;
  --c-beauty:      #B5476E;
  --c-beauty-bg:   #FCF0F4;
  --c-converter:   #7B5EA7;
  --c-converter-bg:#F0EAF8;
  --c-tools:       #4A6FA5;
  --c-tools-bg:    #E6EEF8;
  --c-uk:          #003087;
  --c-uk-bg:       #E6EBF5;
  --c-usa:         #B22234;
  --c-usa-bg:      #FDECEA;
  --c-canada:      #D80621;
  --c-canada-bg:   #FDECEA;
  --c-australia:   #00843D;
  --c-australia-bg:#E2F4EC;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }

/* ── Typography ─────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.label-tag {
  font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 6px; display: block;
}

/* ── Layout ─────────────────────────────────── */
.container        { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 680px;  margin: 0 auto; padding: 0 24px; }

/* ── NAV ─────────────────────────────────────── */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px; height: var(--nav-h);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px; color: var(--text);
  white-space: nowrap; flex-shrink: 0; margin-right: 8px;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex; align-items: center;
  gap: 2px; flex: 1; flex-wrap: nowrap; overflow: hidden;
}
.nav-links > a {
  font-size: 13px; color: var(--muted);
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: .15s; white-space: nowrap; flex-shrink: 0;
}
.nav-links > a:hover,
.nav-links > a.active {
  background: var(--accent-light);
  color: var(--accent); font-weight: 500;
}

/* Country dropdown */
.nav-dropdown { position: relative; flex-shrink: 0; }
.nav-dropdown-btn {
  font-size: 13px; color: var(--muted);
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: none; background: none;
  font-family: var(--font-body);
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  transition: .15s;
}
.nav-dropdown-btn:hover,
.nav-dropdown-btn.active {
  background: var(--accent-light);
  color: var(--accent); font-weight: 500;
}
.nav-arrow { font-size: 10px; transition: .2s; }
.nav-dropdown-btn[aria-expanded="true"] .nav-arrow { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; overflow: hidden;
  display: none; z-index: 300;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 14px;
  color: var(--text); border-bottom: 1px solid var(--border);
  transition: .1s; cursor: pointer;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--accent-light); color: var(--accent); }

/* Nav right — search + hamburger */
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.nav-search-wrap {
  display: flex; align-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 100px; padding: 6px 14px; gap: 6px;
  width: 220px; position: relative;
}
.nav-search-wrap input {
  border: none; background: transparent;
  font-family: var(--font-body); font-size: 13px;
  color: var(--text); outline: none; width: 100%;
}
.nav-search-wrap input::placeholder { color: var(--muted); }
.nav-menu-btn {
  display: none; background: none; border: none;
  font-size: 20px; cursor: pointer; padding: 4px 8px;
  color: var(--text);
}

/* Search results */
#search-results {
  position: absolute; top: calc(100% + 8px);
  left: -40px; right: -40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 300; display: none; max-height: 320px; overflow-y: auto;
}
#search-results.show { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 14px; transition: .1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-light); }
.s-icon { font-size: 18px; flex-shrink: 0; }
.s-name { font-weight: 500; flex: 1; }
.s-cat  { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Mobile menu */
.mobile-menu {
  display: none; flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--surface); padding: 8px 0;
}
.mobile-menu.show { display: flex; }
.mobile-menu a {
  padding: 12px 24px; font-size: 14px;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { background: var(--accent-light); color: var(--accent); }
.mobile-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── AD SLOTS ────────────────────────────────── */
.ad-slot {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 11px;
  letter-spacing: .5px; text-transform: uppercase;
}
.ad-top    { height: 90px; margin: 16px 0; }
.ad-rect   { min-height: 280px; margin: 24px 0; }
.ad-banner { height: 90px; margin: 24px 0; }
.ad-infeed { height: 90px; margin: 12px 0; border-radius: var(--radius); }

/* ── HOME SECTIONS ───────────────────────────── */
.home-section { padding: 32px 0; }
.home-section:first-child { padding-top: 16px; }
.section-header {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.section-header h2 { font-size: 20px; }
.section-header a  { font-size: 13px; color: var(--accent); }
.section-header a:hover { text-decoration: underline; }

/* ── HERO ────────────────────────────────────── */
.home-hero {
  text-align: center; padding: 48px 24px 36px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.home-hero h1 { font-size: 42px; margin-bottom: 12px; }
.home-hero p  { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto 24px; }
.hero-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 10px 20px;
  max-width: 460px; margin: 0 auto;
  box-shadow: var(--shadow);
}
.hero-search input {
  border: none; background: transparent;
  font-family: var(--font-body); font-size: 15px;
  color: var(--text); outline: none; width: 100%;
}
.hero-search input::placeholder { color: var(--muted); }

/* ── CALC CARDS ──────────────────────────────── */
.calc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: block; cursor: pointer; transition: .2s;
  position: relative; overflow: hidden; color: var(--text);
}
.calc-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--card-color, var(--accent));
}
.calc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-icon  { font-size: 26px; margin-bottom: 8px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; font-family: var(--font-body); }
.card-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }
.card-tag {
  display: inline-block; font-size: 11px;
  padding: 2px 10px; border-radius: 100px;
  margin-top: 10px; font-weight: 500;
}

/* Grids */
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ── CATEGORY HUB CARDS ──────────────────────── */
.cat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: block; text-align: center;
  transition: .2s; color: var(--text);
  position: relative; overflow: hidden;
}
.cat-card::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--cat-color, var(--accent));
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cat-icon  { font-size: 36px; margin-bottom: 10px; }
.cat-name  { font-size: 16px; font-weight: 600; margin-bottom: 4px; font-family: var(--font-body); }
.cat-count { font-size: 12px; color: var(--muted); }
.cat-arrow { font-size: 18px; color: var(--muted); margin-top: 8px; }

/* ── COUNTRY CARDS ───────────────────────────── */
.country-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: .2s; color: var(--text);
}
.country-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.country-flag { font-size: 30px; flex-shrink: 0; }
.country-info h3 { font-size: 14px; font-weight: 600; font-family: var(--font-body); margin-bottom: 2px; }
.country-info p  { font-size: 12px; color: var(--muted); }
.country-arrow   { margin-left: auto; color: var(--muted); font-size: 18px; }

/* ── RECENT CARDS ────────────────────────────── */
.recent-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  transition: .2s; color: var(--text);
}
.recent-card:hover { background: var(--accent-light); border-color: var(--accent); }
.recent-icon { font-size: 22px; flex-shrink: 0; }
.recent-name { font-size: 13px; font-weight: 500; }
.recent-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.recent-arrow { margin-left: auto; color: var(--muted); font-size: 16px; }

/* ── CALC PAGE ───────────────────────────────── */
.calc-page-wrap { padding: 24px 0 48px; }
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 20px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.page-hero { margin-bottom: 24px; }
.page-hero h1 { font-size: 30px; margin-bottom: 8px; }
.page-hero p  { color: var(--muted); font-size: 14px; max-width: 560px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.back-link:hover { color: var(--text); }

/* ── CALC FORM ───────────────────────────────── */
.calc-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block; font-size: 13px;
  font-weight: 500; margin-bottom: 6px;
}
.form-group .hint { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

input[type=number], input[type=text],
input[type=date], select, textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px;
  background: var(--bg); color: var(--text);
  outline: none; transition: .15s;
  -moz-appearance: textfield;
}
input[type=number]:focus, input[type=text]:focus,
input[type=date]:focus, select:focus, textarea:focus {
  border-color: var(--accent); background: var(--surface);
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 8px; }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.input-row select { width: 120px; flex: none; }

.calc-btn {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px;
  font-weight: 600; cursor: pointer; transition: .15s; margin-top: 4px;
}
.calc-btn:hover  { opacity: .9; }
.calc-btn:active { transform: scale(.98); }

/* ── RESULT ──────────────────────────────────── */
.result-box { border-radius: var(--radius); overflow: hidden; margin-top: 20px; display: none; }
.result-box.show { display: block; }
.result-hero { background: var(--accent); color: #fff; padding: 22px 24px; text-align: center; }
.result-hero .r-label { font-size: 13px; opacity: .8; margin-bottom: 4px; }
.result-hero .r-value { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.result-hero .r-sub   { font-size: 14px; opacity: .8; margin-top: 4px; }
.result-rows {
  background: var(--surface); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius) var(--radius);
}
.result-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 13px 20px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.rr-label { color: var(--muted); }
.rr-value { font-weight: 600; }

/* ── FAQ ─────────────────────────────────────── */
.faq-section { margin-top: 32px; }
.faq-section h2 { font-size: 22px; margin-bottom: 14px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left; padding: 15px 20px;
  background: none; border: none; font-family: var(--font-body);
  font-size: 14px; font-weight: 500; color: var(--text);
  cursor: pointer; display: flex;
  justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q:hover { background: var(--bg); }
.faq-arrow { font-size: 18px; color: var(--muted); transition: .2s; flex-shrink: 0; }
.faq-q.open .faq-arrow { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: .3s; font-size: 14px; color: var(--muted); line-height: 1.7; }
.faq-a.open { max-height: 300px; padding: 0 20px 16px; }

/* ── FOOTER ──────────────────────────────────── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 40px 24px 24px; margin-top: auto;
}
.footer-grid {
  max-width: 1100px; margin: 0 auto 32px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-logo {
  font-family: var(--font-display); font-size: 22px;
  margin-bottom: 10px; color: var(--text);
}
.footer-logo span { color: var(--accent); }
.footer-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }
.footer-heading { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--text); margin-bottom: 12px; }
.footer-col { display: flex; flex-direction: column; gap: 0; }
.footer-col a { font-size: 13px; color: var(--muted); padding: 4px 0; transition: .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1100px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 20px; text-align: center; }
.footer-bottom p { font-size: 13px; color: var(--muted); }
.footer-note { font-size: 12px; margin-top: 6px; }

/* ── UTILITY ─────────────────────────────────── */
.mt-8  { margin-top: 8px; }  .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 960px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-search-wrap { display: none; }
  .nav-menu-btn { display: block; }
  .home-hero h1 { font-size: 30px; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .container, .container-narrow { padding: 0 16px; }
  .nav-inner { padding: 0 16px; }
  .home-hero { padding: 32px 16px 24px; }
  .home-hero h1 { font-size: 26px; }
  .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .calc-box { padding: 16px; }
  .ad-top { height: 60px; }
}
