/* ═══════════════════════════════════════════════════════════════════
   Galaxyweb AG — Domain TLD Picker
   Standalone Overlay-Komponente für TLD-Auswahl
   Wird im Warenkorb und auf der Domain-Suchseite verwendet.
   ═══════════════════════════════════════════════════════════════════ */

/* TLD Picker Button */
.ci-tld-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--r);
  font-family: var(--font); font-size: 13px; font-weight: 800;
  color: var(--blue-d); background: rgba(0,152,239,.04); cursor: pointer;
  white-space: nowrap; transition: all .2s;
}
.ci-tld-btn:hover { border-color: var(--blue); background: rgba(0,152,239,.08); }
.ci-tld-btn svg { opacity: .35; flex-shrink: 0; transition: transform .2s; }
.ci-tld-btn:hover svg { transform: translateY(1px); }

/* ═══ OVERLAY ═══ */
.tld-picker-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(5,15,35,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  overscroll-behavior: contain;
}
.tld-picker-overlay.open { opacity: 1; pointer-events: auto; }

/* ═══ PANEL ═══ */
.tld-picker {
  background: #fff; border-radius: 18px;
  width: 580px; max-width: calc(100vw - 32px);
  max-height: min(660px, 84vh);
  display: flex; flex-direction: column;
  box-shadow: 0 32px 100px rgba(0,15,50,.25), 0 0 0 1px rgba(0,20,60,.05);
  transform: scale(.95) translateY(16px);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.tld-picker-overlay.open .tld-picker { transform: scale(1) translateY(0); }

/* ═══ HEAD — Dark background ═══ */
.tld-picker-head {
  padding: 20px 24px 14px;
  background: linear-gradient(135deg, #0a1e3d, #0d2d5a);
  border-radius: 18px 18px 0 0;
}
.tld-picker-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.tld-picker-title { display: flex; align-items: center; gap: 10px; }
.tld-picker-title svg { flex-shrink: 0; }
.tld-picker-h { display: block; font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.tld-picker-sub { display: block; font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }
.tld-picker-close {
  width: 34px; height: 34px; border: 1.5px solid rgba(255,255,255,.12); border-radius: 10px;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.tld-picker-close:hover { background: rgba(255,80,80,.2); border-color: rgba(255,80,80,.3); color: #fca5a5; }

/* Search */
.tld-picker-search-wrap { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
.tld-picker-search-ico { position: absolute; left: 12px; opacity: .4; pointer-events: none; stroke: rgba(255,255,255,.5); }
.tld-picker-search {
  flex: 1; padding: 10px 40px 10px 36px;
  border: 1.5px solid rgba(255,255,255,.12); border-radius: 10px;
  font-family: var(--font); font-size: 13px; color: #fff;
  background: rgba(255,255,255,.08); outline: none; transition: all .2s;
}
.tld-picker-search:focus { border-color: rgba(0,152,239,.6); box-shadow: 0 0 0 3px rgba(0,152,239,.15); background: rgba(255,255,255,.12); }
.tld-picker-search::placeholder { color: rgba(255,255,255,.35); }
.tld-picker-count {
  position: absolute; right: 12px;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.1); padding: 2px 8px; border-radius: 6px;
}

/* ═══ FILTER BAR ═══ */
.tld-filter-bar {
  display: flex; gap: 5px;
  flex-wrap: wrap;
}
.tld-filter {
  padding: 5px 12px; border: 1.5px solid rgba(255,255,255,.12); border-radius: 20px;
  background: rgba(255,255,255,.06); cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.55); white-space: nowrap;
  transition: all .15s;
}
.tld-filter:hover { border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.8); background: rgba(255,255,255,.1); }
.tld-filter.active {
  background: #fff; border-color: #fff;
  color: #0a1e3d; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  font-weight: 800;
}

/* ═══ BODY ═══ */
.tld-picker-body {
  flex: 1; overflow-y: auto; padding: 4px 0 16px;
  scrollbar-width: thin; scrollbar-color: rgba(0,30,60,.18) transparent;
  overscroll-behavior: contain;
}
.tld-picker-body::-webkit-scrollbar { width: 5px; }
.tld-picker-body::-webkit-scrollbar-thumb { background: rgba(0,30,60,.18); border-radius: 3px; }
.tld-picker-body::-webkit-scrollbar-thumb:hover { background: rgba(0,30,60,.3); }

/* Categories */
.tld-cat { padding-bottom: 4px; }
.tld-cat + .tld-cat { border-top: 1px solid #f0f4f8; }
.tld-cat:last-child { padding-bottom: 0; }
.tld-cat-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: #5a7290;
  padding: 14px 24px 8px;
}
.tld-cat-ico {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
}
.tld-cat-count {
  font-size: 9px; background: #edf2f8; color: #8fa4b8;
  padding: 2px 8px; border-radius: 10px; margin-left: auto;
  font-weight: 700;
}

/* ═══ CARD GRID ═══ */
.tld-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 0 20px 12px; position: relative; }
.tld-item {
  display: flex; flex-direction: column;
  padding: 11px 13px 10px; border: 1.5px solid #e8eff6; border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left;
  transition: all .18s; position: relative; overflow: visible;
  animation: tldFadeIn .25s ease both;
}
@keyframes tldFadeIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.tld-item:hover { border-color: rgba(0,152,239,.4); background: #f4f9ff; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,100,200,.1); }
.tld-item:active { transform: translateY(0) scale(.97); box-shadow: none; }
.tld-item-head { display: none; }
.tld-item-header { display: none; }
.tld-item-tld {
  font-size: 15px; font-weight: 800; color: #0a1e3d; letter-spacing: -.02em;
}
.tld-item-name {
  font-size: 9.5px; color: #8fa4b8; margin-top: 2px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tld-item-price {
  font-size: 11px; font-weight: 700; color: var(--blue);
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid #f0f4f8;
}

/* Popular cards */
.tld-item-pop {
  border-color: rgba(0,152,239,.2);
  background: linear-gradient(170deg, rgba(0,152,239,.03), #fff 60%);
}
.tld-item-pop .tld-item-tld { color: var(--blue-d); }
.tld-item-pop::after {
  content: 'beliebt'; position: absolute; top: 6px; right: 6px;
  font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: var(--blue); padding: 2px 5px;
  border-radius: 4px; line-height: 1;
}

/* No results */
.tld-no-results {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.tld-no-results p { font-size: 13px; color: #8fa4b8; margin: 0; }

/* ═══ MOBILE: BOTTOM SHEET ═══ */
@media (max-width: 768px) {
  .tld-picker-overlay {
    top: var(--nav-h, 80px); bottom: 0; left: 0; right: 0;
    align-items: stretch;
  }
  .tld-picker {
    width: 100%; max-width: 100%;
    height: 100%; max-height: 100%;
    border-radius: 0;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
  }
  .tld-picker-overlay.open .tld-picker { transform: translateY(0); }
  .tld-picker-head {
    padding: 10px 16px 12px; border-radius: 0;
  }
  .tld-picker-head::before { display: none; }
  .tld-picker-title-row { margin-bottom: 10px; }
  .tld-picker-h { font-size: 15px; }
  .tld-filter-bar { gap: 4px; }
  .tld-filter { font-size: 10px; padding: 4px 10px; }
  .tld-picker-body { padding-bottom: env(safe-area-inset-bottom, 16px); }
  .tld-cat-label { padding: 10px 16px 6px; }
  .tld-cat-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 0 14px 8px; }
  .tld-item { padding: 9px 10px 8px; border-radius: 8px; }
  .tld-item-tld { font-size: 13px; }
  .tld-item-name { font-size: 8.5px; }
  .tld-item-price { font-size: 10px; margin-top: 4px; padding-top: 4px; }
  .tld-item-transfer-price { font-size: 8px; }
  .tld-legend { padding: 8px 14px; gap: 10px; font-size: 9px; }
  .tld-legend-dot { width: 6px; height: 6px; }
  .ci-tld-btn { padding: 8px 10px; font-size: 12px; }
}
@media (max-width: 380px) {
  .tld-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
/* ═══ REGISTRATION NOTE — Badge + Popup ═══ */

/* Badge: kleine Pill oben rechts, analog zu "beliebt" aber amber */
.tld-note-badge {
  position: absolute; top: 6px; right: 6px;
  font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: #7c2d12;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  padding: 2px 5px;
  border-radius: 4px; line-height: 1;
  white-space: nowrap;

  cursor: default; border: none; z-index: 5;
}
/* Bei "beliebt"-Karten: Badge tiefer damit kein Overlap */
.tld-item-pop.tld-item-restricted::after {
  right: 22px; /* knapp neben dem ! Badge */
}


/* Popup: schwebt über der Karte, nicht darin */
.tld-note-popup {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%; transform: translateX(-50%);
  width: 250px;
  background: #0f1f3d;
  color: rgba(255,255,255,.9);
  font-size: 11.5px; font-weight: 400;
  line-height: 1.55;
  padding: 12px 14px 13px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,10,40,.4), 0 0 0 1px rgba(255,255,255,.08);
  z-index: 9999;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
/* Pfeil zeigt nach OBEN (popup ist unterhalb der Karte) */
.tld-note-popup::after {
  content: '';
  position: absolute;
  bottom: 100%; top: auto;
  left: 50%; transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: #0f1f3d;
}
.tld-note-popup-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: #fbbf24; margin-bottom: 7px;
}
.tld-note-popup-title svg { flex-shrink: 0; stroke: #fbbf24; }

/* Desktop: Popup beim Hover auf Karte */
/* Hovered card muss über allen Geschwistern liegen */
.tld-item-restricted:hover {
  z-index: 100;
}
.tld-item-restricted:hover .tld-note-popup {
  display: block;
  animation: notePopIn .18s cubic-bezier(.16,1,.3,1) both;
}
@keyframes notePopIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Linke Spalte: Popup links ausrichten */
.tld-cat-grid > .tld-item-restricted:nth-child(4n+1) .tld-note-popup {
  left: 0; transform: none;
}
.tld-cat-grid > .tld-item-restricted:nth-child(4n+1) .tld-note-popup::after {
  left: 20px; right: auto; transform: none;
}
.tld-cat-grid > .tld-item-restricted:nth-child(4n+1):hover .tld-note-popup {
  animation: notePopInEdge .18s cubic-bezier(.16,1,.3,1) both;
}

/* Rechte Spalten: Popup rechts ausrichten */
.tld-cat-grid > .tld-item-restricted:nth-child(4n) .tld-note-popup,
.tld-cat-grid > .tld-item-restricted:nth-child(4n+3) .tld-note-popup {
  left: auto; right: 0; transform: none;
}
.tld-cat-grid > .tld-item-restricted:nth-child(4n) .tld-note-popup::after,
.tld-cat-grid > .tld-item-restricted:nth-child(4n+3) .tld-note-popup::after {
  left: auto; right: 20px; bottom: 100%; top: auto; transform: none;
}
.tld-cat-grid > .tld-item-restricted:nth-child(4n):hover .tld-note-popup,
.tld-cat-grid > .tld-item-restricted:nth-child(4n+3):hover .tld-note-popup {
  animation: notePopInEdge .18s cubic-bezier(.16,1,.3,1) both;
}
@keyframes notePopInEdge {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Mobile: Popup nach unten, Tap auf Badge zum Öffnen */
@media (max-width: 768px) {
  .tld-item-restricted:hover .tld-note-popup { display: none; }
  .tld-note-popup {
    top: calc(100% + 8px); bottom: auto;
    left: 0; right: 0; transform: none; width: auto;
    pointer-events: auto;
  }
  .tld-note-popup::after {
    bottom: 100%; top: auto; left: 20px; transform: none;
    border-top-color: transparent; border-bottom-color: #0f1f3d;
  }
  .tld-cat-grid > .tld-item-restricted:nth-child(4n) .tld-note-popup,
  .tld-cat-grid > .tld-item-restricted:nth-child(4n+3) .tld-note-popup {
    left: 0; right: 0;
  }
  .tld-item-restricted.tld-note-open .tld-note-popup {
    display: block;
    animation: notePopInMobile .2s cubic-bezier(.16,1,.3,1) both;
  }
  @keyframes notePopInMobile {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Smart flip: wenn zu wenig Platz unten → Popup nach oben */
.tld-item-restricted.tld-popup-up .tld-note-popup {
  top: auto;
  bottom: calc(100% + 10px);
}
/* Pfeil zeigt nach unten wenn Popup oben ist */
.tld-item-restricted.tld-popup-up .tld-note-popup::after {
  bottom: auto !important;
  top: 100% !important;
  border-bottom-color: transparent !important;
  border-top-color: #0f1f3d !important;
}
/* Animationsrichtung umkehren */
.tld-item-restricted.tld-popup-up:hover .tld-note-popup {
  animation: notePopInUp .18s cubic-bezier(.16,1,.3,1) both;
}
@keyframes notePopInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.tld-cat-grid > .tld-item-restricted.tld-popup-up:nth-child(4n+1):hover .tld-note-popup,
.tld-cat-grid > .tld-item-restricted.tld-popup-up:nth-child(4n):hover .tld-note-popup,
.tld-cat-grid > .tld-item-restricted.tld-popup-up:nth-child(4n+3):hover .tld-note-popup {
  animation: notePopInEdgeUp .18s cubic-bezier(.16,1,.3,1) both;
}
@keyframes notePopInEdgeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* Transfer-Preis in TLD-Karte */
.tld-item-transfer-price {
  font-size: 9.5px; font-weight: 600; color: #d97706;
  white-space: nowrap;
}

/* Transfer-Preis — eigene Zeile unter Registrierungspreis */
.tld-item-transfer-price {
  display: block;
  font-size: 9px; font-weight: 700; color: #d97706;
  white-space: nowrap; margin-top: 2px;
}

/* Legende — sticky am Boden der Shadowbox */
.tld-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px;
  border-top: 1px solid #edf2f8;
  background: #fafbfc;
  border-radius: 0 0 18px 18px;
  font-size: 10px; color: #8fa4b8;
  position: sticky; bottom: 0; z-index: 10;
}
.tld-legend-item { display: flex; align-items: center; gap: 5px; }
.tld-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tld-legend-dot.blue  { background: var(--blue); }
.tld-legend-dot.amber { background: #d97706; }
body.dark .tld-legend { background: #131f32; border-top-color: rgba(255,255,255,.08); }