/* =========================================================
   TD Framework: Badges / Pills
========================================================= */

.tdfw-ingredient-tag-badges,
.tdfw-cuisine-flag-badges,
.tdfw-cooking-method-badges,
.tdfw-storage-method-badges,
.tdfw-storage-location-badges,
.tdfw-relationship-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

html body .tdfw-ingredient-tag-badges a,
html body .tdfw-ingredient-tag-badge,
html body .tdfw-cuisine-flag-badge,
html body .tdfw-cooking-method-badge,
html body .tdfw-storage-method-badge,
html body .tdfw-storage-location-badge,
html body .tdfw-relationship-badge,
html body .tdfw-relationship-badge:link,
html body .tdfw-relationship-badge:visited {

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  max-width: fit-content !important;

  min-height: 30px !important;
  height: 30px !important;

  padding: 0.28em 0.68em !important;

  border-radius: 999px !important;

  background: #A14F45 !important;
  border: 1px solid #A14F45 !important;

  color: #FFFAF0 !important;

  font-size: 0.68rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;

  text-decoration: none !important;
  box-shadow: none !important;

  transition: all 0.2s ease;
}

.tdfw-relationship-badge,
.tdfw-relationship-badge:link,
.tdfw-relationship-badge:visited {
  padding: 0.3rem 0.78rem !important;
}

html body .tdfw-ingredient-tag-badges a:hover,
html body .tdfw-cuisine-flag-badges a:hover,
html body .tdfw-cuisine-flag-badge:hover,
html body .tdfw-relationship-badge:hover,
html body .tdfw-relationship-badge:focus {
  background: #C86E66 !important;
  background-color: #C86E66 !important;
  border-color: #C86E66 !important;
  color: #FFFAF0 !important;
  box-shadow: none !important;
}

html body .tdfw-ingredient-tag-badges a:hover *,
html body .tdfw-cuisine-flag-badges a:hover *,
html body .tdfw-cuisine-flag-badge:hover *,
html body .tdfw-relationship-badge:hover *,
html body .tdfw-relationship-badge:focus * {
  color: #FFFAF0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.tdfw-cuisine-flag-icon {
  width: 16px !important;
  height: 11px !important;
  max-width: 16px !important;
  max-height: 11px !important;

  object-fit: cover !important;

  border-radius: 2px !important;

  flex: 0 0 16px !important;
  flex-shrink: 0 !important;

  display: inline-block !important;
}

.tdfw-cuisine-flag-badge.has-icon {
  gap: 0.35em !important;
}

/* =========================================================
   Hero Badge Row
========================================================= */

.tdi-hero-badge-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;

  gap: 0.85rem !important;

  margin: 0 0 1rem !important;
  padding: 0 !important;

  text-align: center;
}

.tdi-badge-group,
.tdi-hero-badge-row .tdfw-cuisine-flag-badges,
.tdi-hero-badge-row .tdfw-ingredient-tag-badges {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;

  gap: 0.35rem !important;

  width: auto !important;

  margin: 0 !important;
  padding: 0 !important;

  line-height: 1 !important;
}

.tdi-badge-divider {
  width: 1px;
  height: 30px;

  flex-shrink: 0;

  background:
    linear-gradient(
      to bottom,
      transparent,
      rgba(255, 250, 240, 0.22),
      transparent
    );
}


/* =========================================================
   Nested Badge Content Reset
   Prevents inner spans from creating a darker hover bubble.
========================================================= */

html body .tdfw-cuisine-flag-badges a span,
html body .tdfw-ingredient-tag-badges a span,
html body .tdfw-cuisine-flag-badge span,
html body .tdfw-ingredient-tag-badge span {
  display: inline !important;

  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;

  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;

  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;

  color: inherit !important;
  line-height: inherit !important;
}

/* =========================================================
   Affiliate Tooltip
========================================================= */

.td-affiliate-link {
  position: relative;
}

.td-affiliate-link::after {
  content: attr(data-tooltip);

  position: absolute;
  left: 50%;
  bottom: 130%;

  transform: translateX(-50%);

  width: 260px;

  padding: 8px 10px;

  border-radius: 8px;

  background: #A14F45;
  color: #FFFAF0;

  font-size: 12px;
  line-height: 1.35;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.2s ease;

  z-index: 9999;
}

.td-affiliate-link:hover::after,
.td-affiliate-link:focus::after {
  opacity: 1;
}
/* =========================================================
   Badge Rendering Fallback / Hard Override
========================================================= */

.tdfw-cuisine-flag-badges > a,
.tdfw-ingredient-tag-badges > a,
.tdfw-cuisine-flag-badges > span,
.tdfw-ingredient-tag-badges > span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35em !important;

  width: auto !important;
  max-width: fit-content !important;
  height: 30px !important;
  min-height: 30px !important;

  padding: 0.28em 0.68em !important;
  border-radius: 999px !important;

  background: #A14F45 !important;
  border: 1px solid #A14F45 !important;

  color: #FFFAF0 !important;
  font-size: 0.68rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.tdfw-cuisine-flag-badges img,
.tdfw-cuisine-flag-badge img,
.tdfw-cuisine-flag-icon {
  width: 16px !important;
  height: 11px !important;
  max-width: 16px !important;
  max-height: 11px !important;
  object-fit: cover !important;
  border-radius: 2px !important;
  display: inline-block !important;
  flex: 0 0 16px !important;
}
