/* Martin Woo Reviews 0.4.0: emoji reactions on the product reviews. Loaded with assets/js/reactions.js on product
   pages that have reviews. The row lives in #reviews; the bar, the breakdown and the toast are added to <body> by the
   script and placed with el.style (no style attribute in printed markup). Colours come from product-reviews.css's
   custom properties, with fallbacks. The theme's base button rule (grey fill, white text, 10px 20px) is reset. */
.mwr-rx, .mwr-rx-bar, .mwr-rx-pop, .mwr-rx-toast {
    --rx-ink: var(--mwr-ink, #1f1a17);
    --rx-muted: var(--mwr-muted, #7d7368);
    --rx-line: var(--mwr-line, #e6ddd0);
    --rx-cream: var(--mwr-cream, #f7f1e6);
    --rx-burgundy: var(--mwr-burgundy, #3d0101);
    --rx-gold: var(--mwr-gold, #c99a2e);
    --rx-gold-soft: var(--mwr-gold-soft, #d3b287);
    --rx-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
.mwr-rx [hidden], .mwr-rx-bar[hidden], .mwr-rx-pop[hidden] { display: none !important; }

/* The row, under the review text */
.single-product #reviews .mwr-rx {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 0;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.single-product #reviews .mwr-rx button {
    -webkit-appearance: none; appearance: none; margin: 0; min-height: 0; width: auto; box-shadow: none; text-transform: none;
    letter-spacing: normal; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: background-color .15s, border-color .15s, color .15s;
}

/* Like (the viewer's reaction in place of the thumb once they react) */
.single-product #reviews .mwr-rx .mwr-rx-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px 0 11px; box-sizing: border-box;
    border: 1px solid var(--rx-line); border-radius: 999px; background: #fff; color: var(--rx-muted);
    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .03em;
}
.single-product #reviews .mwr-rx .mwr-rx-btn:hover { border-color: var(--rx-gold-soft); background: var(--rx-cream); color: var(--rx-burgundy); }
.single-product #reviews .mwr-rx .mwr-rx-btn:active { transform: scale(.96); }
.single-product #reviews .mwr-rx button:focus { outline: none; }
.single-product #reviews .mwr-rx button:focus-visible { outline: 2px solid var(--rx-gold); outline-offset: 2px; }
.single-product #reviews .mwr-rx .mwr-rx-ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; }
/* The thumb (no reaction yet): drawn here once, in the text colour, instead of an SVG printed in every row */
.single-product #reviews .mwr-rx .mwr-rx-ico:not(.is-emoji)::before {
    content: ""; display: block; width: 17px; height: 17px; background: currentColor;
    -webkit-mask: var(--mwr-rx-thumb) center / 17px 17px no-repeat; mask: var(--mwr-rx-thumb) center / 17px 17px no-repeat;
}
.single-product #reviews .mwr-rx {
    --mwr-rx-thumb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v11'/%3E%3Cpath d='M15 5.9 14 10h5.8a2 2 0 0 1 1.9 2.5l-2.3 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.8a2 2 0 0 0 1.8-1.1L12 2a3.1 3.1 0 0 1 3 3.9Z'/%3E%3C/svg%3E");
}
@media (forced-colors: active) { .single-product #reviews .mwr-rx .mwr-rx-ico:not(.is-emoji)::before { background: ButtonText; forced-color-adjust: none; } }
.single-product #reviews .mwr-rx .mwr-rx-ico.is-emoji { font: 18px/1 var(--rx-emoji); }
.single-product #reviews .mwr-rx .mwr-rx-ico.is-pop { animation: mwr-rx-pop .45s cubic-bezier(.2, .9, .3, 1.5); }
.single-product #reviews .mwr-rx .mwr-rx-btn[aria-pressed="true"] { border-color: #e6d7bd; background: var(--rx-cream); color: var(--rx-burgundy); }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="like"] { color: #2f5fb3; }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="love"] { color: #c0263b; }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="devil"] { color: #7a3aa0; }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="drops"] { color: #2a7cbf; }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="eggplant"] { color: #6b3a99; }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="peach"] { color: #d0652a; }
.single-product #reviews .mwr-rx .mwr-rx-btn[data-r="pepper"] { color: #c2341c; }

/* Count and top-3 stack (tap: the breakdown) */
.single-product #reviews .mwr-rx .mwr-rx-sum {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 6px; box-sizing: border-box;
    border: 0; border-radius: 999px; background: transparent; color: var(--rx-muted);
    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums;
}
.single-product #reviews .mwr-rx .mwr-rx-sum:hover,
.single-product #reviews .mwr-rx .mwr-rx-sum[aria-expanded="true"] { background: var(--rx-cream); color: var(--rx-ink); }
.single-product #reviews .mwr-rx .mwr-rx-stack { display: inline-flex; align-items: center; padding-left: 4px; }
.single-product #reviews .mwr-rx .mwr-rx-s {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: -5px;
    border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(31, 26, 23, .18); font: 13px/1 var(--rx-emoji);
}
.single-product #reviews .mwr-rx .mwr-rx-s:nth-child(1) { z-index: 3; position: relative; }
.single-product #reviews .mwr-rx .mwr-rx-s:nth-child(2) { z-index: 2; position: relative; }

/* Bianca's mark: "<emoji> by Bianca" (not counted), in the gold of her The Model badge */
.single-product #reviews .mwr-rx .mwr-rx-mark {
    display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 5px; box-sizing: border-box;
    border: 1px solid #dcb560; border-radius: 999px; background: linear-gradient(135deg, #fdf0c8 0%, #f6dc8f 100%);
    box-shadow: 0 1px 3px rgba(180, 130, 30, .18); color: #7a3d05;
    font: 700 11px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.single-product #reviews .mwr-rx .mwr-rx-me {
    display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%;
    background: #fff; font: 12px/1 var(--rx-emoji); letter-spacing: 0;
}
.single-product #reviews .mwr-rx .mwr-rx-mark.is-pop .mwr-rx-me { animation: mwr-rx-pop .45s cubic-bezier(.2, .9, .3, 1.5); }

/* The bar of 7, above the button (below when there is no room) */
.mwr-rx-bar {
    position: fixed; z-index: 100000; top: 0; left: 0; display: flex; gap: 2px; padding: 5px 7px; box-sizing: border-box;
    border-radius: 999px; background: #fff; box-shadow: 0 10px 30px rgba(31, 26, 23, .2), 0 0 0 1px rgba(201, 154, 46, .35);
    opacity: 0; transform: translateY(8px) scale(.85); transform-origin: var(--mwr-rx-ox, 30px) 100%;
    transition: opacity .14s ease, transform .2s cubic-bezier(.2, .9, .3, 1.3);
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.mwr-rx-bar.is-below { transform: translateY(-8px) scale(.85); transform-origin: var(--mwr-rx-ox, 30px) 0; }
.mwr-rx-bar.is-open { opacity: 1; transform: none; }
.mwr-rx-bar .mwr-rx-opt {
    -webkit-appearance: none; appearance: none; position: relative; display: block; width: 42px; height: 42px; margin: 0; padding: 0;
    border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: none;
}
.mwr-rx-bar .mwr-rx-opt:focus { outline: none; }
.mwr-rx-bar .mwr-rx-opt:focus-visible { box-shadow: 0 0 0 2px var(--rx-gold); }
.mwr-rx-bar .mwr-rx-oe {
    display: block; font: 30px/42px var(--rx-emoji); text-align: center; transform-origin: 50% 85%;
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.4);
}
.mwr-rx-bar.is-open .mwr-rx-opt { animation: mwr-rx-in .32s cubic-bezier(.2, .9, .3, 1.4) both; }
.mwr-rx-bar.is-open .mwr-rx-opt:nth-child(2) { animation-delay: .025s; }
.mwr-rx-bar.is-open .mwr-rx-opt:nth-child(3) { animation-delay: .05s; }
.mwr-rx-bar.is-open .mwr-rx-opt:nth-child(4) { animation-delay: .075s; }
.mwr-rx-bar.is-open .mwr-rx-opt:nth-child(5) { animation-delay: .1s; }
.mwr-rx-bar.is-open .mwr-rx-opt:nth-child(6) { animation-delay: .125s; }
.mwr-rx-bar.is-open .mwr-rx-opt:nth-child(7) { animation-delay: .15s; }
.mwr-rx-bar .mwr-rx-opt:hover .mwr-rx-oe,
.mwr-rx-bar .mwr-rx-opt:focus-visible .mwr-rx-oe,
.mwr-rx-bar .mwr-rx-opt.is-hot .mwr-rx-oe { transform: translateY(-6px) scale(1.35); }
/* The label above the emoji */
.mwr-rx-bar .mwr-rx-opt::after {
    content: attr(data-label); position: absolute; bottom: calc(100% + 12px); left: 50%; padding: 4px 9px; border-radius: 999px;
    background: rgba(31, 26, 23, .92); color: #fff; font: 600 11px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    letter-spacing: .03em; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, 4px); transition: opacity .12s, transform .12s;
}
.mwr-rx-bar .mwr-rx-opt:hover::after,
.mwr-rx-bar .mwr-rx-opt:focus-visible::after,
.mwr-rx-bar .mwr-rx-opt.is-hot::after { opacity: 1; transform: translate(-50%, 0); }
/* The viewer's current reaction: a gold dot under it */
.mwr-rx-bar .mwr-rx-opt.is-current::before {
    content: ""; position: absolute; bottom: -1px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--rx-gold);
}

/* The breakdown: counts per type, no names */
.mwr-rx-pop {
    position: fixed; z-index: 100000; top: 0; left: 0; min-width: 170px; max-width: calc(100vw - 16px); padding: 10px 14px 8px; box-sizing: border-box;
    border: 1px solid #e6d7bd; border-top: 3px solid var(--rx-gold-soft); border-radius: 10px; background: #fff;
    box-shadow: 0 10px 30px rgba(31, 26, 23, .16); color: var(--rx-ink); font: 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .14s;
}
.mwr-rx-pop.is-open { opacity: 1; transform: none; }
.mwr-rx-pop .mwr-rx-pop-h { margin: 0 0 6px; color: var(--rx-muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.mwr-rx-pop ul { margin: 0; padding: 0; list-style: none; }
.mwr-rx-pop li { display: flex; align-items: center; gap: 10px; margin: 0; padding: 5px 0; border-top: 1px solid #f1ebe1; }
.mwr-rx-pop li:first-child { border-top: 0; }
.mwr-rx-pop .mwr-rx-pe { width: 22px; font: 18px/1 var(--rx-emoji); text-align: center; }
.mwr-rx-pop .mwr-rx-pl { flex: 1; }
.mwr-rx-pop .mwr-rx-pn { font-weight: 700; color: var(--rx-burgundy); font-variant-numeric: tabular-nums; }

/* Error toast */
.mwr-rx-toast {
    position: fixed; z-index: 100001; left: 50%; bottom: 20px; max-width: calc(100vw - 32px); padding: 11px 18px; box-sizing: border-box;
    border-radius: 999px; background: rgba(31, 26, 23, .94); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    font: 600 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center;
    opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.mwr-rx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@keyframes mwr-rx-pop { 0% { transform: scale(.4); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes mwr-rx-in { 0% { opacity: 0; transform: translateY(10px) scale(.5); } 100% { opacity: 1; transform: none; } }

@media (max-width: 400px) {
    .mwr-rx-bar { padding: 4px 5px; gap: 1px; }
    .mwr-rx-bar .mwr-rx-opt { width: 40px; height: 40px; }
    .mwr-rx-bar .mwr-rx-oe { font-size: 28px; line-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    .mwr-rx-bar, .mwr-rx-pop, .mwr-rx-toast, .mwr-rx-bar .mwr-rx-oe, .mwr-rx-bar .mwr-rx-opt::after { transition: none; }
    .mwr-rx-bar.is-open .mwr-rx-opt, .single-product #reviews .mwr-rx .mwr-rx-ico.is-pop, .single-product #reviews .mwr-rx .mwr-rx-mark.is-pop .mwr-rx-me { animation: none; }
}
