/* Hero demo: the extension's ranked list as a small interactive panel next to the
 * headline. Style follows the owner's reference - a shaded dark board, product tiles
 * with a faint rim, a double outline on selected controls. Every class is prefixed
 * "hd-" and scoped under .hero-demo so nothing collides with the page's own CSS.
 * Markup is built by hero-demo.js from the page's data-demo copy.
 */
.hero-demo {
  --hd-radius: 4px;             /* the site's single corner radius */
  --hd-green: #8CC63F;
  --hd-note: #70A030;           /* brand green at 3.1:1 on white, for the handwritten note */
  --hd-board: #161622; --hd-tile: #252531;
  --hd-rim: rgba(255,255,255,.045); --hd-rim-top: rgba(255,255,255,.09); --hd-rim-on: rgba(255,255,255,.36);
  --hd-text: #F2F3F5; --hd-soft: #CFD0D6; --hd-muted: #9193A0; /* 4.7:1 on the tiles */ --hd-raised: #33333f;
  --hd-ease: cubic-bezier(.45,0,.2,1);
  /* double outline: outer line, dark gap, inner line */
  --hd-dbl: 0 0 0 1px rgba(255,255,255,.34), inset 0 0 0 2px #1c1c26, inset 0 0 0 3px rgba(255,255,255,.12), 0 6px 16px rgba(0,0,0,.5);
  width: 100%; max-width: 460px; margin: 20px 0; position: relative;
}
.hero-demo *, .hero-demo *::before, .hero-demo *::after { box-sizing: border-box; }
.hero-demo p { margin: 0; }

/* ---- handwritten note above the panel; tilts up along the reading direction ---- */
.hd-try { display: flex; align-items: flex-end; gap: 4px; margin: 0 0 10px; padding-inline-start: 28px; color: var(--hd-note); pointer-events: none; }
.hd-try span { line-height: 1.05; white-space: nowrap; transform: rotate(-4deg); transform-origin: left bottom; }
.hd-try svg { width: 58px; height: 46px; margin-bottom: -6px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .hd-try span { transform: rotate(4deg); transform-origin: right bottom; }
[dir="rtl"] .hd-try svg { transform: scaleX(-1); }

/* ---- the board and its tiles ---- */
.hd-panel { position: relative; font-family: 'Heebo', var(--hd-font, sans-serif), sans-serif; color: var(--hd-text); text-align: start;
            border-radius: var(--hd-radius); padding: 6px; user-select: none;
            background: radial-gradient(130% 90% at 25% 0%, #1c1c29 0%, var(--hd-board) 55%, #121219 100%);
            box-shadow: 0 18px 30px -18px rgba(12,13,20,.35); }
.hd-tile { position: relative; border-radius: var(--hd-radius); background: linear-gradient(180deg, #292935, var(--hd-tile) 35%, #242430);
           box-shadow: inset 0 1px 0 var(--hd-rim-top), inset 0 0 0 1px var(--hd-rim), inset 0 0 18px rgba(255,255,255,.018), 0 3px 12px rgba(0,0,0,.35);
           transition: transform .75s var(--hd-ease), box-shadow .4s; }

.hd-top { padding: 16px 14px 14px; }
.hd-head { display: flex; align-items: center; margin-bottom: 16px; }
.hd-logo { display: flex; align-items: center; gap: 8px; direction: ltr; }
.hd-logo img { width: 18px; height: 26px; display: block; }
.hd-logo span { font-family: 'Titillium Web', sans-serif; font-size: 16px; font-weight: 700; letter-spacing: .6px; color: #ECEDEF; }
.hd-logo i { font-style: normal; color: var(--hd-green); }

/* Controls: unselected = one faint line; selected = the double outline. */
.hd-tabs { display: flex; gap: 8px; margin-bottom: 16px; padding: 1px; }
.hd-tab { flex: 1; min-width: 0; text-align: center; height: 36px; line-height: 36px; padding: 0 4px; border-radius: var(--hd-radius);
          font-size: 13.5px; font-weight: 500; color: var(--hd-muted); white-space: nowrap; overflow: hidden;
          box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); transition: background .35s, color .35s, box-shadow .35s, transform .12s; }
.hd-tab.on { color: var(--hd-text); background: linear-gradient(180deg, #30303b, #282832); box-shadow: var(--hd-dbl); }
.hd-tab.hover { color: var(--hd-text); }
.hd-sortrow { display: flex; align-items: center; gap: 7px; height: 26px; padding-inline-start: 1px; font-size: 12.5px; color: var(--hd-muted); white-space: nowrap; }
.hd-sl { margin-inline-end: 2px; }
.hd-sv { color: var(--hd-soft); }
.hd-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--hd-radius); font-size: 12px; color: var(--hd-muted);
           box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); transition: color .3s, box-shadow .3s, background .3s, transform .12s; }
.hd-chip.on { color: var(--hd-text); background: #262630; box-shadow: var(--hd-dbl); }
.hd-fadein { animation: hd-fadein .35s ease both; }
@keyframes hd-fadein { from { opacity: 0; transform: translateY(3px); } }
.hd-press { transform: scale(.95); }

/* ---- products ---- */
.hd-list { position: relative; height: 322px; margin-inline: 14px; }
.hd-card { position: absolute; inset-inline: 0; top: 0; padding: 16px 18px 10px; } /* height: set by hero-demo.js to the tallest card */
.hd-card::before { content: ''; position: absolute; inset: 3px; border-radius: calc(var(--hd-radius) - 3px); pointer-events: none;
                   box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); opacity: 0; transition: opacity .4s; }
.hd-card.first::before { opacity: 1; }
.hd-card.rising { z-index: 2; }
.hd-r1, .hd-r2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hd-n { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.4px; direction: ltr; }
.hd-n small { font-size: 13px; font-weight: 500; color: var(--hd-muted); margin-inline-start: 2px; letter-spacing: 0; }
.hd-lead { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; color: var(--hd-soft); white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity .3s; }
.hd-lead::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--hd-green); flex-shrink: 0; }
.hd-lead.show { opacity: 1; }
.hd-r2 { margin-top: 9px; font-size: 13px; }
.hd-name { flex: 1; min-width: 0; color: var(--hd-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-name em { font-style: normal; color: var(--hd-muted); }
.hd-price { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; white-space: nowrap; }
.hd-price s { font-weight: 400; font-size: 11.5px; color: var(--hd-muted); }
.hd-r3 { min-height: 24px; margin-top: 4px; }
.hd-info { display: flex; align-items: center; gap: 9px; min-height: 24px; }
.hd-why { flex: 1; min-width: 0; font-size: 12px; color: var(--hd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Plain facts, not buttons: the sale tag and the better-size note. */
.hd-tag { height: 18px; line-height: 18px; padding: 0 6px; border-radius: var(--hd-radius); font-size: 10.5px; font-weight: 600; color: #c4e398; background: rgba(140,198,63,.12); white-space: nowrap; }
.hd-note { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #b4d88a; white-space: nowrap; transition: color .3s, text-shadow .3s; }
.hd-note svg { width: 10px; height: 10px; }
.hd-note.hot { color: #d9f0b8; text-shadow: 0 0 10px rgba(140,198,63,.6); }

.hd-explain { min-height: 48px; padding: 12px 14px 6px; font-size: 11.5px; line-height: 1.55; color: #9A9CA7; transition: opacity .25s; }
.hd-explain b { font-weight: 600; color: var(--hd-soft); }

/* the visitor's turn */
.hd-live .hd-tab, .hd-live .hd-chip { cursor: pointer; }
.hd-live .hd-tab:not(.on):hover, .hd-live .hd-chip:not(.on):hover { color: var(--hd-text); }
.hd-live .hd-card:not(.first):hover::before { opacity: .45; }

.hd-cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 9; pointer-events: none; opacity: 0;
             transition: transform .8s var(--hd-ease), opacity .35s; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.hd-cursor svg { display: block; width: 100%; height: 100%; transform-origin: 3px 2px; transition: transform .12s; }
.hd-cursor.down svg { transform: scale(.84); }
.hd-ripple { position: absolute; z-index: 8; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
             box-shadow: 0 0 0 1.5px rgba(255,255,255,.6); animation: hd-ripple .55s ease-out forwards; }
@keyframes hd-ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }

/* ---- caption under the panel: the extension works on every iHerb category ---- */
.hd-caption { margin-top: 22px; text-align: center; font-size: 14px; line-height: 1.6; color: #767676; }
.hd-cats { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 6px; }
.hd-rot { position: relative; display: inline-block; height: 1.6em; overflow: hidden; vertical-align: bottom; text-align: start; }
.hd-rot span { display: block; white-space: nowrap; color: #4D4D4D; font-weight: 600; transition: transform .35s ease, opacity .35s ease; }
.hd-rot span.out { position: absolute; inset-inline-start: 0; top: 0; transform: translateY(-100%); opacity: 0; }
.hd-rot span.in { transform: translateY(100%); opacity: 0; }

/* When the headline column and the demo no longer fit side by side, the demo wraps
   under the text: center it there. */
@media (max-width: 1099px) { .hero-demo { margin: 40px auto 0; } }
@media (max-width: 440px) {
  .hd-panel { padding: 5px; }
  .hd-top { padding: 14px 10px 12px; } .hd-list { margin-inline: 10px; } .hd-card { padding-inline: 14px; } .hd-tab { font-size: 12.5px; }
  .hd-sortrow { gap: 5px; overflow-x: auto; scrollbar-width: none; margin-inline: -1px; padding-inline: 2px; }
  .hd-sortrow::-webkit-scrollbar { display: none; }
  .hd-sortrow.chips .hd-sl { display: none; } .hd-chip { flex-shrink: 0; padding: 0 7px; font-size: 11.5px; }
  .hd-price s { display: none; }
  /* Narrow cards: the weight after the name goes (the price per 100 g says it), and the
     sale tag and size note get their own line under the reason. hero-demo.js evens out
     the card heights, so the list re-spaces itself. */
  .hd-name em { display: none; }
  .hd-info { flex-wrap: wrap; align-content: flex-start; row-gap: 4px; }
  .hd-why { flex: 1 0 100%; }
}
