/* ════════════════════════════════════════════════════
   TROUVETAKAZ.COM — Header
   ════════════════════════════════════════════════════ */

/* ══ HEADER ══ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: box-shadow var(--t2);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

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

/* ── Logo ── */
.logo {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-dot {
  color: var(--orange);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--orange);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* ── Search bar header ── */
.header-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
}

.header-search:hover {
  border-color: var(--orange);
}

.header-search:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232,115,74,.12);
  background: var(--surface);
}

.header-search svg {
  width: 16px;
  height: 16px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.header-search input {
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  outline: none;
  width: 100%;
}

.header-search input::placeholder { color: var(--text3); }

/* ── Actions droite ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Sélecteur territoire ── */
.territory-selector {
  position: relative;
}

.territory-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}

.territory-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-light);
}

.territory-btn .flag {
  font-size: 16px;
  line-height: 1;
}

.territory-btn .name {
  font-weight: 600;
  color: var(--text);
}

.territory-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  transition: transform var(--t);
}

.territory-btn.open svg {
  transform: rotate(180deg);
}

/* Dropdown territoire */
.territory-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--t2), transform var(--t2);
}

.territory-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.territory-dropdown-header {
  padding: 14px 16px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border2);
}

.territory-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--t);
}

.territory-option:hover {
  background: var(--bg);
}

.territory-option.active {
  background: var(--orange-light);
}

.territory-option .flag {
  font-size: 20px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.territory-option-info { flex: 1; }

.territory-option-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.territory-option-currency {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}

.territory-option-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t);
}

.territory-option.active .territory-option-check { opacity: 1; }

.territory-option-check svg {
  width: 10px;
  height: 10px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
}

.territory-coming {
  padding: 10px 16px;
  background: var(--bg2);
  border-top: 1px solid var(--border2);
}

.territory-coming-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.territory-coming-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.territory-coming-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11px;
  color: var(--text3);
}

/* ── Nav links ── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 12px;
  border-radius: var(--r2);
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: all var(--t);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg);
}

.nav-link.active {
  color: var(--orange);
  background: var(--orange-light);
  font-weight: 600;
}

/* ── User menu ── */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t);
}

.user-btn:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}

.user-btn .avatar-sm {
  background: var(--orange);
  color: #fff;
  border: none;
  font-size: 12px;
}

.user-btn-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--t2), transform var(--t2);
}

.user-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border2);
}

.user-dropdown-name {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.user-dropdown-email {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--t);
  text-decoration: none;
}

.dropdown-item:hover { background: var(--bg); color: var(--text); }
.dropdown-item.danger:hover { background: var(--red-light); color: var(--red); }

.dropdown-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.dropdown-sep { height: 1px; background: var(--border2); margin: 4px 0; }

/* ── Bouton Publier ── */
.btn-publish {
  background: var(--orange);
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: var(--r2) !important;
  font-family: 'Syne', sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  box-shadow: var(--shadow-orange);
  transition: all var(--t) !important;
}

.btn-publish:hover {
  background: var(--orange-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,115,74,.4) !important;
}

/* ── Mobile header ── */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r3);
  background: var(--bg);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 20px;
  z-index: 190;
  box-shadow: var(--shadow-md);
}

.mobile-nav.open { display: block; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r2);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t);
  text-decoration: none;
}

.mobile-nav-link:hover { background: var(--bg); }
.mobile-nav-link.active { color: var(--orange); background: var(--orange-light); }

.mobile-nav-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.mobile-nav-sep { height: 1px; background: var(--border); margin: 8px 0; }

@media (max-width: 768px) {
  .header-search   { display: none; }
  .header-nav      { display: none; }
  .mobile-menu-btn { display: flex; }
  .header-inner    { padding: 0 16px; }
  .user-btn-name   { display: none; }
}

@media (max-width: 480px) {
  .territory-btn .name { display: none; }
}

/* ══ FOOTER ══ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  padding: 48px 0 32px;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .logo { color: #fff; margin-bottom: 12px; }

.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  max-width: 220px;
}

.footer-col-title {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.footer-link {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,.55);
  margin-bottom: 8px;
  cursor: pointer;
  transition: color var(--t);
  text-decoration: none;
}

.footer-link:hover { color: var(--orange); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,.35);
}

.footer-territories {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-territory {
  font-size: 18px;
  opacity: .5;
  cursor: default;
  transition: opacity var(--t);
}

.footer-territory.active {
  opacity: 1;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}
