/* /estensione: how to use the browser extension, laid out like the home (site.css: nav, hero, section,
   title-xl, group, faq, final). The pieces marked data-ui are the extension's own interface, working
   (design/estensione, Giorno). No inline styles or scripts: the CloudFront CSP forbids them. */

.ic { width: 1em; height: 1em; fill: currentColor; flex: none; }
.x-scene [hidden], .x-how [hidden], .x-amazon [hidden] { display: none !important; }
.x-browsers { margin-top: 16px; font-size: 15px; color: var(--ink-muted); }

/* ---------- Hero scene: a shop page and the popup reading it, on the home's lilac blob ---------- */
.x-scene { min-height: 560px; }
.x-shop { position: absolute; z-index: 1; left: 4%; top: 6%; width: 320px; border-radius: var(--radius-lg); background: var(--paper-raised); overflow: hidden; box-shadow: var(--shadow-card); transform: rotate(-2deg); } /* taste-skill-ignore: a page behind the open popup */
.x-shop__bar { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 12px; background: var(--paper-sunk); font-size: 12px; color: var(--ink-muted); }
.x-shop__url { flex: 1; min-width: 0; height: 26px; padding: 0 10px; overflow: hidden; border-radius: 999px; background: var(--paper-raised); line-height: 26px; white-space: nowrap; text-overflow: ellipsis; }
.x-shop__ext { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.x-badge { position: absolute; right: -3px; bottom: -2px; width: 13px; height: 13px; border-radius: 4px; background: var(--mint); opacity: 0; transform: scale(.4); transition: opacity .2s, transform .36s cubic-bezier(.34, 1.56, .64, 1); }
.x-badge::after { content: ""; position: absolute; left: 4px; top: 2px; width: 3px; height: 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.x-shop__ext.is-saved .x-badge { opacity: 1; transform: none; }
.x-shop__body { padding: 14px 14px 18px; }
.x-shop__photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-md); background: var(--paper-sunk); }
.x-shop__name { margin-top: 12px; font: 700 16px/1.3 var(--font-sans); }
.x-shop__price { margin-top: 4px; font: 600 19px/1 var(--font-display); }
/* Three open tabs: picking one changes the page, and the popup reads it (estensione.js) */
.x-tabs { display: flex; gap: 2px; padding: 8px 8px 0; background: var(--paper-sunk); }
.x-tab { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; height: 32px; padding: 0 10px; border: 0; border-radius: 10px 10px 0 0; background: none; color: var(--ink-muted); font: 600 12px/1 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.x-tab:hover { color: var(--ink); }
.x-tab[aria-selected="true"] { background: var(--paper-raised); color: var(--ink); }
.x-fav { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.x-fav--scarpe { background: #127a4a; }
.x-fav--casa { background: #d4940a; }
.x-fav--piante { background: #1f9a5f; }
.x-shop__bar { background: var(--paper-raised); }

/* ---------- The popup (Giorno) ---------- */
.x-pop { width: 320px; border-radius: 18px; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.45; }
.x-scene .x-pop { position: absolute; z-index: 2; right: 0; bottom: 4%; box-shadow: var(--shadow-float); } /* taste-skill-ignore: the popup is open over the page */
.x-pop__head { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; font: 600 18px/1 var(--font-display); }
.x-pop__body { display: flex; flex-direction: column; gap: 12px; padding: 2px 16px 16px; }
.x-pop__title { font: 600 21px/1.2 var(--font-display); }
.x-card { border-radius: 20px; background: var(--paper-raised); }
.x-product { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; }
.x-thumb { display: block; flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--paper-sunk); }
.x-thumb--s { width: 46px; height: 46px; font-size: 21px; }
.x-product__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.x-product__title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.x-product__store { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.x-field { display: flex; flex-direction: column; gap: 8px; }
.x-label { font: 600 16px/1.2 var(--font-display); }
.x-lists { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 20px; background: var(--paper-raised); }
.x-opt { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 14px; background: none; color: inherit; font: 700 15px/1.2 var(--font-sans); text-align: left; cursor: pointer; transition: background .15s; }
.x-opt .ic { font-size: 19px; }
.x-opt:hover { background: var(--paper-sunk); }
.x-opt[aria-checked="true"] { background: var(--ribbon-soft); }
.x-add, .x-done { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 999px; font: 600 17px/1 var(--font-display); }
.x-add { border: 0; background: var(--ribbon); color: var(--on-ribbon); cursor: pointer; transition: transform 120ms var(--ease-press); }
.x-add:active { transform: scale(.97); }
.x-done { background: var(--mint-soft); color: var(--mint); }
.x-add .ic, .x-done .ic { font-size: 20px; }
.x-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
.x-qr img { width: 112px; height: 112px; padding: 8px; border-radius: 12px; background: #fff; box-sizing: content-box; }
.x-code { font: 600 19px/1 var(--font-display); letter-spacing: .08em; }
.x-wait { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.x-spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--ribbon); border-radius: 50%; animation: x-spin .9s linear infinite; }
@keyframes x-spin { to { transform: rotate(1turn); } }

/* ---------- How it works: the section stays pinned, the scroll walks four steps (estensione.js) ---------- */
.x-how { padding: 0; }
.x-how__pin { padding: 88px 0 56px; }
.js .x-how { height: calc(100svh + 160vh); } /* the card plus a bit more than a screen and a half of scroll for four steps */
.js .x-how__pin { position: sticky; top: 68px; padding: clamp(16px, 5vh, 56px) 0; }
.x-how__card { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-top: clamp(20px, 4vh, 40px); padding: clamp(24px, 4vh, 40px) 40px; border-radius: var(--radius-xl); background: var(--paper-raised); box-shadow: var(--shadow-card); } /* taste-skill-ignore: the home's .step card */
.x-how__text { display: flex; flex-direction: column; gap: 12px; }
.x-how__step-title { font: 600 32px/1.15 var(--font-display); }
.x-how__text p { max-width: 44ch; color: var(--ink-muted); font-size: 17px; }
.x-how__frag { display: grid; place-items: center; height: clamp(300px, 42vh, 380px); padding: 20px 28px; overflow: hidden; border-radius: var(--radius-lg); background: var(--paper-sunk); } /* one height for every step: the card never grows and the steps stay on screen */
.x-stage { width: min(100%, 400px); }
.x-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.x-step { display: flex; flex-direction: column; gap: 10px; padding: 0; border: 0; background: none; color: var(--ink-muted); font: 500 16px/1.3 var(--font-sans); text-align: left; cursor: pointer; }
.x-step:hover, .x-step.is-on { color: var(--ink); }
.x-step.is-on { font-weight: 700; }
.x-step i { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.x-step i::after { content: ""; display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--ribbon); transform: scaleX(var(--fill, 0)); transform-origin: left; }
.x-step.is-done i::after { transform: none; }

.x-toolbar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px 0 14px; border-radius: 14px 14px 0 0; background: var(--paper-raised); color: var(--ink-muted); }
.x-toolbar__url { flex: 1; min-width: 0; height: 28px; padding: 0 12px; overflow: hidden; border-radius: 999px; background: var(--paper-sunk); font-size: 13px; line-height: 28px; white-space: nowrap; text-overflow: ellipsis; }
.x-toolbar__btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; font-size: 18px; }
.x-toolbar__btn--on { background: var(--paper-sunk); }
.x-menu { padding: 6px; border-radius: 12px; background: var(--paper-raised); color: var(--ink); font: 400 14px/20px system-ui, -apple-system, sans-serif; box-shadow: var(--shadow-float); } /* taste-skill-ignore: an open menu */
.x-menu--ext { width: 250px; margin: 6px 0 0 auto; }
.x-menu__head { padding: 8px 10px 6px; font-weight: 600; color: var(--ink-muted); }
.x-menu__row { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 10px; border-radius: 6px; }
.x-menu__row > span:first-of-type { flex: 1; }
.x-menu__row kbd { font: inherit; color: var(--ink-muted); }
.x-menu__row--on { background: var(--ribbon); color: var(--on-ribbon); }
.x-menu__row--on kbd { color: inherit; }
.x-pin { flex: none !important; color: var(--ribbon); font-size: 16px; }
.x-pop--flat { width: 100%; }
.x-app__title { font: 600 26px/1.1 var(--font-display); }
.x-app__sub { margin: 4px 0 12px; font-size: 14px; color: var(--ink-muted); }
.x-wish { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 7px 14px 7px 7px; border-radius: 18px; background: var(--paper-raised); }
.x-wish b { display: block; font-size: 15px; }
.x-wish small { display: block; font-size: 13px; color: var(--ink-muted); }

/* ---------- Amazon: the home's group layout, on mint (the switch is on) ---------- */
#amazon { background: var(--mint-soft); transition: background .4s; }
#amazon.is-off { background: var(--paper-sunk); }
.x-amazon { transform: rotate(1.5deg); }
.x-amazon__row { display: flex; align-items: center; gap: 16px; }
.x-amazon__text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.x-amazon__text b { font: 600 20px/1.2 var(--font-display); }
.x-amazon__text small { font-size: 14px; color: var(--ink-muted); }
.x-switch { position: relative; flex: none; width: 60px; height: 36px; padding: 0; border: 0; border-radius: 999px; background: var(--mint); cursor: pointer; transition: background .25s; }
.x-switch span { position: absolute; top: 4px; left: 28px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: left .3s var(--ease-out); }
.x-switch[aria-checked="false"] { background: var(--line-strong); }
.x-switch[aria-checked="false"] span { left: 4px; }
.x-amazon__page { position: relative; margin-top: 24px; padding: 16px; border-radius: var(--radius-md); background: var(--paper-sunk); }
.x-amazon__photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #fff; }
.x-pill { position: absolute; right: 26px; bottom: 26px; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 9px; border-radius: 999px; background: var(--paper-raised); font: 600 16px/1 var(--font-display); box-shadow: var(--shadow-float); transition: opacity .3s, transform .3s var(--ease-out); } /* taste-skill-ignore: it floats over Amazon's page */
#amazon.is-off .x-pill { opacity: 0; transform: translateY(10px); }

/* ---------- Phone and tablet ---------- */
@media (max-width: 959px) {
  .x-scene { min-height: 600px; }
  .x-shop { left: 0; top: 0; width: min(300px, 78vw); }
  .x-scene .x-pop { width: min(320px, 86vw); }
}
@media (max-width: 760px) {
  .js .x-how__pin { padding: 16px 0; }
  .x-how .title-xl { font-size: 28px; }
  .x-how__card { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; padding: 16px; }
  .x-how__frag { order: -1; height: clamp(190px, 30svh, 290px); padding: 12px; }
  .x-qr { gap: 6px; padding: 10px; }
  .x-qr img { width: 84px; height: 84px; }
  .x-how__frag .x-stage { transform: scale(.82); }
  .x-how__step-title { font-size: 24px; }
  .x-how__text p { font-size: 16px; }
  .x-how__text { min-height: 10.5em; } /* the longest step's text: the card keeps one height */
  .x-steps { gap: 10px; margin-top: 16px; }
  .x-step { font-size: 14px; }
  .x-amazon { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .x-spin { animation: none; } }
/* Short screens: the QR step is the tallest, it fits the fixed frame a bit smaller */
@media (max-height: 820px) and (min-width: 761px) {
  .x-how__frag .x-pop__head { height: 42px; }
  .x-how__frag .x-qr { gap: 6px; padding: 12px; }
  .x-how__frag .x-qr img { width: 84px; height: 84px; }
}
/* Small phones (an iPhone SE): a smaller heading, the fragment scaled further */
@media (max-width: 760px) and (max-height: 720px) {
  .x-how .title-xl { font-size: 24px; }
  .x-how__frag { height: 230px; }
  .x-how__frag .x-stage { transform: scale(.68); }
}
