/*
  Per-method highlight badge (e.g. "الأسرع" / "Recommended" / "Best value").

  Shared across all 8 card layouts rather than duplicated into each
  layout-*.css file: this
  only ever needs one property that's true of every layout already -
  .shipping-method-option is "position: relative" in every one of them
  (confirmed by grep across all eight layout-*.css files) - so a single
  "position: absolute" placement rule here works unmodified everywhere,
  with no risk of the flex-direction/row-vs-column differences that
  actually matter for icon sizing.

  --hfe-shipping-badge-color is set from the "Shipping Form" admin tab's
  color picker (see includes/frontend.php); the value below is just the
  fallback so the badge still looks intentional if that inline override
  is ever missing.
*/

:root {
    --hfe-shipping-badge-color: #f5a623;
}

.shipping-method-badge {
    position: absolute;
    top: -9px;
    inset-inline-start: 10px;
    z-index: 2;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--hfe-shipping-badge-color);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .1px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
    pointer-events: none;
}

/* --- Specificity fix (1.8.6) ---
   assets/css/order-summary.css (always enqueued, unconditional) carries a
   defensive "#shipping-methods * { max-width: 100%; }" backstop against
   the grid-blowout bug fixed in 1.8.3. That's an ID + universal selector,
   specificity (1,0,0) - it beats this file's old plain ".shipping-method-badge"
   class rule, specificity (0,1,0), regardless of load order, so the
   badge's intended "calc(100% - 20px)" (20px clearance so long badge text
   can never reach the card's far edge) was silently overridden back up to
   a flat 100%. Re-declared here with matching ID+class specificity so the
   badge's own clearance rule actually wins - confirmed by comparing both
   files' selectors directly, not a guess. */
#shipping-methods .shipping-method-badge {
    max-width: calc(100% - 20px);
}

@media (max-width: 480px) {
    .shipping-method-badge {
        top: -7px;
        inset-inline-start: 6px;
        padding: 2px 7px;
        font-size: 9.5px;
    }
}
