/*────────────────────────────────────────────────────────────
   ROOT: Fluid badge sizing
   ----------------------------------------------------------*/
:root {
  /* Never smaller than 28px, scale at 10vw, cap at 70px */
  --badge-size: clamp(28px, 10vw, 70px);
}

/*────────────────────────────────────────────────────────────
   Make the cover wrapper the positioning context
   ────────────────────────────────────────────────────────────*/
.ps-focus__cover {
  position: relative;
}

/*────────────────────────────────────────────────────────────
   Make the cover-inner a positioned container for desktop
   ────────────────────────────────────────────────────────────*/
.ps-focus__cover-inner.ps-js-cover-button-popup {
  position: relative;
  overflow: visible;
}

/*────────────────────────────────────────────────────────────
   1) TOOLTIP STYLES (DESKTOP ONLY)
   ────────────────────────────────────────────────────────────*/

  .dokan-seller-badge-item.tips[title] {
    position: relative;
  }
  .dokan-seller-badge-item.tips[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 999;
  }
  .dokan-seller-badge-item.tips[title]:hover::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
  }


/*────────────────────────────────────────────────────────────
   2) DESKTOP LAYOUT (≥ 981px)
   ────────────────────────────────────────────────────────────*/
@media (min-width: 61.25em) {
  .ps-focus__title {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .ps-focus__title-after {
    align-self: flex-start;
    transform: translateY(-25px);
  }
  .ps-focus__title-after img {
    vertical-align: top;
  }
  .ps-focus__name {
    display: inline-block;
    min-width: 175px;
  }

  /* Inline, fluid badges beside the name */
  .ps-focus__title .dokan-seller-badges-in-peepso {
    display: inline-flex;
    align-items: center;
    margin-left: 20px;
    gap: 0;
    position: static;
  }
}

/*────────────────────────────────────────────────────────────
   UNIVERSAL BADGE STYLING
   ────────────────────────────────────────────────────────────*/
.dokan-seller-badge-item {
  position: relative;
  width: var(--badge-size);
}
.dokan-seller-badge-item img {
  width: 100%;
  height: auto;
}
/* Bubble is always 30% of icon, 15% below its bottom */
.dokan-seller-badge-item strong.bottom-center {
  position: absolute;
  bottom: calc(-0.15 * var(--badge-size));
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50%;
  font-weight: 500;
  color: #000;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

/*────────────────────────────────────────────────────────────
   3) MOBILE LAYOUT (< 980px)
   ────────────────────────────────────────────────────────────*/
@media (max-width: 61.24em) {
  /* 1) Release the inner wrapper so badges don’t anchor to it */
  .ps-focus__cover-inner.ps-js-cover-button-popup {
    position: static !important;
  }

  /* 2) Now badge span will find .ps-focus__cover as its positioning context */
  .ps-focus__cover .dokan-seller-badges-in-peepso {
    position: absolute !important;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    padding: 2px 4px;
    border-radius: 10px;
    display: flex;
    gap: 0px;
    z-index: 10;
    overflow: visible;
  }
  
  
  /* NEW: keep the inline badges invisible on mobile
     (they’ll be displayed again after JS moves them) */
  .ps-focus__title .dokan-seller-badges-in-peepso {
    display: none !important;
  }

  /* Tooltip shift for first two badges */
  .ps-focus__cover .dokan-seller-badges-in-peepso
    .dokan-seller-badge-item:nth-child(-n+2).tips[title]:hover::after {
    left: 0;
    transform: none;
    max-width: 90vw;
  }

  /* Keep fluid sizing & adjust bubble on mobile */
  .ps-focus__cover .dokan-seller-badges-in-peepso .dokan-seller-badge-item {
    width: var(--badge-size);
  }
  .ps-focus__cover .dokan-seller-badges-in-peepso
    .dokan-seller-badge-item strong.bottom-center {
    width: 11px;
    height: 11px;
    font-size: 0.625rem;
  }
}
