:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #24302a;
  --ink-soft: #5c6b62;
  --line: #e4ddd0;
  --accent: #1d4d3d;
  --accent-ink: #ffffff;
  --pin: #e0623f;
  --land: #dfe6de;
  --land-visited: #c9704a;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 40, 35, 0.06);
}

* { box-sizing: border-box; }

/* Author styles would otherwise override the browser's default [hidden] rule
   (author CSS beats UA CSS regardless of specificity) — this keeps elements
   with the hidden attribute truly hidden. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  padding: 2rem 1.25rem 1rem;
  text-align: center;
  position: relative;
}

.nav-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover { text-decoration: underline; }

/* Theme switcher pill — shared across all three pages (Harta e Dashurisë /
   Harta e Lindjes / Harta e Udhëtimeve) so switching feels identical from
   any page. Wraps on narrow screens since the labels are the full page
   names rather than short tags. */
.theme-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  background: rgba(29, 77, 61, 0.06);
  border-radius: 14px;
  padding: 0.25rem;
  margin-bottom: 0.9rem;
}
.switcher-tab {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
}
.switcher-tab:hover { color: var(--ink); }
.switcher-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(30, 40, 35, 0.12);
}

.site-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0 auto;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.step-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(29, 77, 61, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.hint {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Autocomplete */
.autocomplete {
  position: relative;
}

#countryInput {
  width: 100%;
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

#countryInput:focus {
  outline: none;
  border-color: var(--accent);
}

.suggestions {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.3rem;
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}

.suggestions[hidden] { display: none; }

.suggestions li {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.suggestions li:hover,
.suggestions li.active {
  background: rgba(29, 77, 61, 0.08);
}

.suggestions .no-results {
  color: var(--ink-soft);
  cursor: default;
}
.suggestions .no-results:hover { background: none; }

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  min-height: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(29, 77, 61, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.chip button {
  border: none;
  background: rgba(29, 77, 61, 0.15);
  color: var(--accent);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.count-line {
  margin: 0.7rem 0 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
  width: 100%;
}

.btn:active { transform: scale(0.99); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

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

.btn-large {
  padding: 1rem 1.4rem;
  font-size: 1.05rem;
}

/* Map */
.map-card {
  transition: none;
}

.map-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #eef3f0, #e7efe9);
}

.map-container {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.map-container.revealed {
  max-height: 900px;
}

.map-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-container .country {
  fill: var(--land);
  stroke: #ffffff;
  stroke-width: 0.6;
  transition: fill 0.2s ease;
}

.map-container .country.visited {
  fill: var(--land-visited);
}

.map-container .pin {
  fill: var(--pin);
  stroke: #ffffff;
  stroke-width: 1.1;
}

/* Products */
.product-block {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.product-block:last-child { margin-bottom: 0; }

.product-toggle {
  display: block;
  cursor: pointer;
}

.product-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.product-toggle-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
}

.product-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.product-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.product-toggle-text strong { font-size: 1rem; }
.product-toggle-text small { color: var(--ink-soft); font-size: 0.82rem; }

.product-toggle input:checked + .product-toggle-card {
  background: rgba(29, 77, 61, 0.06);
}

.product-toggle input:focus-visible + .product-toggle-card {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.product-inner {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  display: none;
}

.product-block.expanded .product-inner {
  display: block;
}

/* Photo book */
.book-countries {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.book-country {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
}

.book-country-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.book-country-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.book-country-count {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.photo-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px dashed var(--line);
  background: #fff;
  color: var(--accent);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.photo-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.photo-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.size-note {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.size-note.warn { color: #b3261e; }

/* Frame size */
.size-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 480px) {
  .size-grid { grid-template-columns: repeat(3, 1fr); }
}

.size-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.size-card {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  cursor: pointer;
  text-align: center;
}

.size-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.size-card small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.size-option input:checked + .size-card {
  border-color: var(--accent);
  background: rgba(29, 77, 61, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.size-option input:focus-visible + .size-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Form */
.field {
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea {
  font-size: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 480px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.field-row .field { margin-bottom: 0; }

.form-message {
  min-height: 1.2rem;
  font-size: 0.9rem;
  margin: 0.9rem 0 0.7rem;
}

.form-message.error { color: #b3261e; }
.form-message.success { color: var(--accent); font-weight: 600; }

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 1.5rem 1rem 3rem;
}
