/* ============================================================
   TZ eSIM Routing Display — Stylesheet
   Globe icon + tooltip + popular eSIM cards
   ============================================================ */

/* ── GLOBE ICON ON PRODUCT CARDS ─────────────────────────── */

.tz-routing-wrap {
  position: relative;
  display: inline-block;
  margin: 6px 0;
}

.tz-routing-globe {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f0ff;
  border: 1.5px solid #e0e0ff;
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6c5ce7;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.tz-routing-globe:hover {
  background: #e8e4ff;
  border-color: #7c5cfc;
}
.tz-routing-label {
  font-size: 12px;
}

/* ── TOOLTIP ── */

.tz-routing-tooltip {
  display: none;
  position: fixed; /* fixed so it's never clipped by card overflow */
  z-index: 99999;
  min-width: 220px;
  max-width: 280px;
  background: #1a1a2e;
  border: 1px solid rgba(124,92,252,.3);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  pointer-events: none;
}
/* Arrow — positioned by JS */
.tz-routing-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%; left: 20px;
  border: 7px solid transparent;
  border-bottom-color: rgba(124,92,252,.3);
}
.tz-routing-tooltip::after {
  content: '';
  position: absolute;
  bottom: calc(100% - 1px); left: 21px;
  border: 6px solid transparent;
  border-bottom-color: #1a1a2e;
}

.tz-routing-tooltip.visible {
  display: block;
  animation: tz-fadein .15s ease;
}

@keyframes tz-fadein {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── TOOLTIP ROWS ── */

.tz-rt-inner { display: flex; flex-direction: column; gap: 10px; }

.tz-rt-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tz-rt-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: rgba(255,255,255,.4);
}
.tz-rt-val {
  font-size: 13px;
  font-weight: 600;
  color: #f0f0ff;
  line-height: 1.4;
}
.tz-rt-highlight {
  color: #9d7ffe;
  font-weight: 700;
}
.tz-rt-coverage em {
  color: rgba(255,255,255,.4);
  font-style: normal;
  font-size: 11px;
}

/* ── SINGLE PRODUCT ROUTING SECTION ── */

.tz-routing-single {
  background: #f8f7ff;
  border: 1.5px solid #e0dcff;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.tz-routing-single-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: #6c5ce7;
  margin-bottom: 12px;
}
.tz-routing-single-body .tz-rt-inner { gap: 12px; }
.tz-routing-single-body .tz-rt-label { color: #9ca3af; }
.tz-routing-single-body .tz-rt-val   { color: #1a1a2e; }
.tz-routing-single-body .tz-rt-highlight { color: #6c5ce7; }

/* ── POPULAR eSIMS SECTION ── */

.tz-popular-section {
  padding: 40px 0;
  font-family: 'Inter', -apple-system, sans-serif;
}

.tz-popular-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 12px;
}
.tz-popular-title {
  font-size: 26px !important;
  font-weight: 800 !important;
  color: #1a1a2e !important;
  margin: 0 0 4px !important;
  letter-spacing: -.3px;
}
.tz-popular-sub {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}
.tz-popular-all {
  font-size: 14px;
  font-weight: 600;
  color: #6c5ce7;
  text-decoration: none;
  white-space: nowrap;
}
.tz-popular-all:hover { text-decoration: underline; }

/* Scrollable container */
.tz-popular-scroller {
  position: relative;
}

/* Grid */
.tz-popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* Card */
.tz-popular-card {
  background: #fff;
  border: 1.5px solid #f0f0f0;
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: default;
}
.tz-popular-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(108,92,231,.12);
  border-color: #c4b5fd;
}

/* Image */
.tz-popular-img-wrap {
  position: relative;
  height: 140px;
  overflow: visible; /* allow tooltip to show outside card boundaries */
  border-radius: 14px 14px 0 0; /* keep rounded corners on image itself */
}
.tz-popular-img-wrap img {
  border-radius: 14px 14px 0 0;
}
.tz-popular-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.tz-popular-card:hover .tz-popular-img-wrap img {
  transform: scale(1.06);
}
.tz-popular-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.4) 100%);
}

/* Globe on card image */
.tz-popular-globe-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
}
.tz-popular-globe {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #6c5ce7;
  transition: background .15s, transform .15s;
}
.tz-popular-globe:hover {
  background: #fff;
  transform: scale(1.1);
}

/* Routing tooltip on popular card */
.tz-popular-routing-tip {
  display: none;
  position: fixed; /* fixed so never clipped by card overflow */
  z-index: 99999;
  min-width: 200px;
  max-width: 260px;
  background: #1a1a2e;
  border: 1px solid rgba(124,92,252,.3);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  pointer-events: none;
}
.tz-popular-routing-tip::before {
  content: '';
  position: absolute;
  bottom: 100%; right: 12px;
  border: 7px solid transparent;
  border-bottom-color: rgba(124,92,252,.3);
}
.tz-popular-routing-tip::after {
  content: '';
  position: absolute;
  bottom: calc(100% - 1px); right: 13px;
  border: 6px solid transparent;
  border-bottom-color: #1a1a2e;
}
.tz-popular-routing-tip .tz-rt-row { margin-bottom: 8px; }
.tz-popular-routing-tip .tz-rt-row:last-child { margin-bottom: 0; }

.tz-popular-routing-tip.visible {
  display: block;
  animation: tz-fadein .15s ease;
}

/* Card body */
.tz-popular-body {
  padding: 14px;
}
.tz-popular-flag-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tz-popular-flag { font-size: 22px; }
.tz-popular-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
}
.tz-popular-price { margin-bottom: 10px; }
.tz-popular-from {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}
.tz-popular-amount {
  font-size: 18px;
  font-weight: 800;
  color: #6c5ce7;
}
.tz-popular-amount .amount { color: inherit; }
.tz-popular-amount .woocommerce-Price-currencySymbol { font-size: 13px; }

/* View Plans button — matches client image */
.tz-popular-btn {
  display: block;
  text-align: center;
  background: #6c5ce7;
  color: #fff !important;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  transition: background .15s, transform .1s;
}
.tz-popular-btn:hover {
  background: #5b4cdb;
  transform: translateY(-1px);
}

/* Scroll arrows */
.tz-popular-arrow {
  display: none;
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  z-index: 10; color: #1a1a2e;
  align-items: center; justify-content: center;
}
.tz-popular-arrow-prev { left: -18px; }
.tz-popular-arrow-next { right: -18px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .tz-popular-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .tz-popular-scroller { overflow-x: auto; padding-bottom: 8px; }
  .tz-popular-grid {
    grid-template-columns: repeat(3, 160px);
    gap: 12px;
    width: max-content;
    padding-bottom: 4px;
  }
  .tz-popular-arrow { display: flex; }
  .tz-popular-title { font-size: 20px !important; }
  .tz-routing-tooltip { left: 0; transform: none; }
  .tz-routing-tooltip::after { left: 20px; transform: none; }
}

/* ── SINGLE PRODUCT ROUTING — ENHANCED ── */

.tz-routing-single {
  background: linear-gradient(135deg, #f8f7ff 0%, #f0edff 100%);
  border: 2px solid #e0dcff;
  border-radius: 14px;
  padding: 18px 20px;
  margin: 20px 0;
}
.tz-routing-single-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #6c5ce7;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0dcff;
}
.tz-routing-single-body .tz-rt-inner {
  gap: 14px;
  flex-direction: row;
  flex-wrap: wrap;
}
.tz-routing-single-body .tz-rt-row {
  background: #fff;
  border: 1px solid #e8e4ff;
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 140px;
  flex: 1;
}
.tz-routing-single-body .tz-rt-label {
  color: #9ca3af;
  font-size: 11px;
  margin-bottom: 4px;
}
.tz-routing-single-body .tz-rt-val {
  font-size: 14px;
  color: #1a1a2e;
  font-weight: 600;
}
.tz-routing-single-body .tz-rt-highlight {
  color: #6c5ce7;
  font-size: 16px;
  font-weight: 700;
}
.tz-routing-single-body .tz-rt-coverage {
  flex-basis: 100%;
}

/* Ensure card overflow visible for tooltip */
.tz-popular-card {
  overflow: visible !important;
}
