/* --- Variables --- */
:root {
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #5c5c5c;
  --color-accent: #c45c26;
  --color-accent-hover: #a04a1e;
  --color-border: #e5e3df;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --ad-bg: #f0eeeb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  order: 1;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 280px;
}
.header-search input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.header-search button {
  padding: 0.4rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.header-search button:hover {
  background: var(--color-accent-hover);
}
@media (max-width: 600px) {
  .header-search { order: 3; max-width: 100%; }
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.logo span {
  color: var(--color-accent);
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-header nav a {
  margin-left: 0;
  padding: 0.4rem 0.6rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius);
  white-space: nowrap;
}

.site-header nav a:hover {
  color: var(--color-accent);
}

/* Create Invoice = belirgin buton */
.site-header nav a[href="select-country.html"],
.site-header nav a[href="../select-country.html"] {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
}

.site-header nav a[href="select-country.html"]:hover,
.site-header nav a[href="../select-country.html"]:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* Mobil: navbar daha kompakt */
@media (max-width: 768px) {
  .site-header {
    padding: 0.5rem 0;
  }

  .header-inner {
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.15rem;
  }

  .site-header nav {
    gap: 0.35rem;
  }

  .site-header nav a {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
  }

  .site-header nav a[href="select-country.html"],
  .site-header nav a[href="../select-country.html"] {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .site-header nav a {
    font-size: 0.75rem;
    padding: 0.3rem 0.4rem;
  }

  .site-header nav a[href="select-country.html"],
  .site-header nav a[href="../select-country.html"] {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }
}

/* --- Ad slots: Google AdSense compliant ---
   Policy: content must exceed ads; label as "Advertisement"; max ~3 display units per long page, 2 on short.
   Sizes: https://support.google.com/adsense/answer/6002621 */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  min-height: 50px;
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--ad-bg);
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.ad-placeholder span {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ad-placeholder small {
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Desktop: Leaderboard 728x90 */
.ad-leaderboard .ad-placeholder {
  width: 728px;
  height: 90px;
  max-width: 100%;
}

.ad-medium-rect .ad-placeholder {
  width: 300px;
  height: 250px;
}

.ad-in-article .ad-placeholder {
  width: 100%;
  min-height: 250px;
  max-width: 100%;
}

/* AdSense reklamları için container stilleri */
.adsbygoogle {
  display: block;
  text-align: center;
}

.ad-leaderboard .adsbygoogle {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

.ad-in-article .adsbygoogle {
  width: 100%;
  margin: 1.5rem 0;
}

.ad-large-rect .ad-placeholder {
  width: 336px;
  height: 280px;
}

/* Mobile: AdSense recommended mobile sizes (320x100, 300x250) */
@media (max-width: 768px) {
  .ad-leaderboard .ad-placeholder {
    width: 320px;
    height: 100px;
  }

  .ad-slot {
    margin: 1rem 0;
  }
}

@media (max-width: 400px) {
  .ad-leaderboard .ad-placeholder {
    width: 300px;
    height: 100px;
  }
}

/* --- Main: prevent CLS when 3rd-party scripts set height --- */
main {
  height: auto;
}

/* --- Hero: reserve space to reduce CLS (font load, layout shift) --- */
.hero {
  padding: 3rem 0;
  text-align: center;
  min-height: 20rem;
  contain: layout;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.25;
  min-height: 3.2em;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 1.75rem;
  min-height: 5em;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

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

/* --- Content sections --- */
.content-section {
  padding: 2rem 0;
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.content-section p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.content-section p:last-child {
  margin-bottom: 0;
}

.feature-list,
.steps-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
}

.feature-list li,
.steps-list li {
  margin-bottom: 0.75rem;
}

.country-seo-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
  list-style: disc;
}
.country-seo-list li {
  margin-bottom: 0.5rem;
}
.country-seo-list a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}
.country-seo-list a:hover {
  text-decoration: underline;
}
@media (min-width: 700px) {
  .country-seo-list {
    column-count: 2;
    column-gap: 2rem;
  }
}

.content-section.cta {
  text-align: center;
  padding: 3rem 0;
}

.content-section.cta p {
  margin-bottom: 1.25rem;
}

/* --- Invoice page --- */
.invoice-page .container {
  max-width: 900px;
}

.invoice-page h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}

.form-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

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

/* Line items table */
.items-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.items-table th,
.items-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.items-table th {
  font-weight: 600;
  background: var(--color-bg);
}

.items-table input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.items-table .col-desc { min-width: 180px; }
.items-table .col-qty { width: 80px; }
.items-table .col-price { width: 100px; }
.items-table .col-total { width: 100px; }
.items-table .col-actions { width: 44px; }

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.totals-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  max-width: 280px;
  margin-left: auto;
}

.totals-box .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.totals-box .row.grand-total {
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.generate-row {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

/* --- Footer (thin) --- */
.site-footer {
  margin-top: 3rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0 0 0.35rem;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--color-accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-legal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.footer-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  color: var(--color-accent);
}

.footer-seal svg {
  width: 100%;
  height: 100%;
}
