/* ==========================================================================
   layout.css — variables, resets, navbar, footer, breadcrumb, mobile nav
   ========================================================================== */

:root {
  --primary:        #1B4FD8;
  --primary-light:  #EFF6FF;
  --primary-dark:   #1338A0;
  --accent:         #0EA5E9;
  --success:        #16A34A;
  --warning:        #D97706;
  --danger:         #DC2626;

  --bg-page:        #F8FAFC;
  --bg-white:       #FFFFFF;

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-tertiary:  #94A3B8;

  --border:         #E2E8F0;
  --border-dark:    #CBD5E1;

  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md:      0 4px 12px rgba(15, 23, 42, 0.08);

  --container-width: 1250px;
  --navbar-height:   60px;
  --bottom-nav-height: 56px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
}

h2 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}

h3 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

small, .text-small {
  font-size: 12px;
}

.text-tiny {
  font-size: 11px;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: var(--bg-white);
  border-color: var(--border-dark);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  white-space: nowrap;
}

.chip.is-active,
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.navbar-menu {
  display: none;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.navbar-logo:hover {
  text-decoration: none;
}

.navbar-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.navbar-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
}

.navbar-links a:hover,
.navbar-links a.is-active {
  color: var(--primary);
  text-decoration: none;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Country badge in navbar */
.country-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-primary);
}

/* Search */
.navbar-search {
  display: flex;
  align-items: center;
}

.search-box {
  display: none;
  align-items: center;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.search-box.is-open {
  display: flex;
}

.search-box input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: 12px 0;
  font-size: 12px;
  color: var(--text-tertiary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb .sep {
  margin: 0 6px;
  color: var(--text-tertiary);
}

.breadcrumb .current {
  color: var(--text-primary);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 40px;
  padding: 32px 0 calc(24px + var(--bottom-nav-height));
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.footer-col h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.footer-col ul li {
  margin-bottom: 6px;
}

.footer-col a {
  color: var(--text-secondary);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ---------- Mobile bottom navigation ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottom-nav-height);
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}

.bottom-nav-inner {
  display: flex;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.bottom-nav-item.is-active {
  color: var(--primary);
}

.bottom-nav-item i {
  font-size: 18px;
}

/* ---------- Ad slots ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  background: var(--bg-page);
  color: var(--text-tertiary);
  font-size: 12px;
}

.ad-slot--sidebar_top .ad-placeholder,
.ad-slot--sidebar_bottom .ad-placeholder {
  min-height: 250px;
}

.ad-slot--mobile_banner .ad-placeholder {
  min-height: 50px;
}

.ad-slot--mobile_banner {
  display: none;
}

/* ---------- Country chips row ---------- */
.country-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.country-chips::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Mobile (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .navbar-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .navbar-menu {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 8px 16px 16px;
  }

  .navbar-menu.is-open {
    display: flex;
  }

  .navbar-menu a {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 500;
  }

  .navbar-menu a:last-child {
    border-bottom: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .bottom-nav {
    display: block;
  }

  .ad-slot--mobile_banner {
    display: flex;
  }

  body {
    padding-bottom: var(--bottom-nav-height);
  }
}
