/* Sova Mart — glass icons and glass-framed photos.
 * Icons become small frosted-glass tiles (translucent fill, bright rim, top gloss, soft inner tint).
 * Photos get a glass "pane" on top: thin light rim, a diagonal reflection, a light sweep on hover and,
 * on mouse devices, a highlight that follows the pointer (--gx/--gy from fx3d.js).
 * Pure CSS: works in every browser; backdrop blur where supported. All motion off for reduced-motion.
 */

/* ---------- shared glass recipe ---------- */
.perk > span, .glass-icon, .icon-btn, .wish, .logo-mark, .qty button {
  --glass-tint: var(--c, rgba(255, 79, 139, .35));
  position: relative; isolation: isolate; overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .35) 45%, rgba(255, 255, 255, .15) 100%),
    var(--glass-tint) !important;
  border: 1px solid rgba(255, 255, 255, .75) !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .95),
    inset 0 -8px 14px -6px rgba(120, 70, 200, .22),
    0 6px 16px rgba(60, 30, 120, .14),
    0 1px 2px rgba(60, 30, 120, .12) !important;
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
}
/* top gloss: a curved highlight across the upper half */
.perk > span::before, .glass-icon::before, .icon-btn::before, .wish::before, .logo-mark::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 4%; height: 46%; z-index: 2; pointer-events: none; border-radius: 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .05));
  opacity: .75;
}
/* light sweep across icons on hover */
.perk > span::after, .glass-icon::after, .icon-btn::after, .logo-mark::after {
  content: ""; position: absolute; inset: -40%; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .75) 50%, transparent 60%);
  transform: translateX(-70%); transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}
.perk:hover > span::after, .cat:hover .glass-icon::after, .logo:hover .logo-mark::after { transform: translateX(70%); }

/* ---------- icons ---------- */
.perk > span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; flex: none; }
.perk:nth-child(4n+1) { --c: rgba(255, 79, 139, .38); } .perk:nth-child(4n+2) { --c: rgba(47, 211, 154, .38); }
.perk:nth-child(4n+3) { --c: rgba(255, 201, 60, .45); } .perk:nth-child(4n+4) { --c: rgba(52, 198, 255, .38); }
html.playful .perk:nth-child(4n+1) { --c: rgba(255, 79, 139, .38); } html.playful .perk:nth-child(4n+2) { --c: rgba(47, 211, 154, .38); }
html.playful .perk:nth-child(4n+3) { --c: rgba(255, 201, 60, .45); } html.playful .perk:nth-child(4n+4) { --c: rgba(52, 198, 255, .38); }
html.playful .perk { box-shadow: 0 5px 0 var(--cs, #ffd6e6), var(--shadow); }
html.playful .perk:nth-child(4n+1) { --cs: #ffd6e6; } html.playful .perk:nth-child(4n+2) { --cs: #c9f3e2; }
html.playful .perk:nth-child(4n+3) { --cs: #fff0b8; } html.playful .perk:nth-child(4n+4) { --cs: #cdefff; }
.perk > span { font-size: 1.6em; }

.glass-icon { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 24px; margin-bottom: 4px; }
.glass-icon .cat-emoji { font-size: 2.3rem; position: relative; z-index: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .15)); }
.glass-icon .cat-img { width: 100%; height: 100%; border-radius: inherit; position: relative; z-index: 1; }
.glass-icon { --c: rgba(255, 255, 255, .18); }   /* clear glass: the tile colour shows through */

.icon-btn { --c: rgba(255, 201, 60, .45); overflow: visible; }
.icon-btn::before { left: 14%; right: 14%; border-radius: 999px 999px 50% 50%; }
.icon-btn::after { content: none; }   /* no sweep: the badge needs overflow visible, so it would show outside the circle */
.icon-btn .badge { z-index: 4; }
.wish { --c: rgba(255, 79, 139, .22); position: absolute; z-index: 4; }
.wish.inline { position: relative; }
.logo-mark { --c: rgba(255, 79, 139, .85); color: #fff; text-shadow: 0 1px 2px rgba(150, 20, 70, .5); }
html.playful .logo-mark { background: linear-gradient(160deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .05) 55%), linear-gradient(135deg, #ff4f8b, #ffc93c) !important; }
.qty button { --c: rgba(255, 201, 60, .4); }
.qty button::before { content: none; }

/* ---------- photos: a glass pane over every product and character picture ---------- */
.pvisual, .char-pic { position: relative; isolation: isolate; overflow: hidden; }
.char-pic { display: block; width: 100%; border-radius: 14px; }
.char-pic img { display: block; }
.pvisual::before, .char-pic::before {         /* rim light + diagonal reflection */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65), inset 0 1px 0 1px rgba(255, 255, 255, .55), inset 0 -18px 30px -18px rgba(60, 30, 120, .25);
  background:
    linear-gradient(125deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .12) 24%, transparent 25%, transparent 62%, rgba(255, 255, 255, .10) 63%, transparent 78%),
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, .35), transparent 60%);
}
.pvisual::after, .char-pic::after {           /* light sweep on hover + pointer highlight */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .35s;
  background:
    radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255, 255, 255, .45), transparent 42%),
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%) no-repeat;
  background-size: 100% 100%, 260% 100%; background-position: 0 0, 150% 0;
}
.card:hover .pvisual::after, .char:hover .char-pic::after, .pvisual.large:hover::after { opacity: 1; animation: glassSweep 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes glassSweep { from { background-position: 0 0, 150% 0; } to { background-position: 0 0, -50% 0; } }
.pvisual > span { position: relative; z-index: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .15)); }
/* product photos sit on a soft frosted tile */
.pvisual { box-shadow: 0 8px 18px -10px rgba(60, 30, 120, .35); }

/* cinematic theme: glass on a dark stage */
html.cinematic .perk > span, html.cinematic .glass-icon, html.cinematic .icon-btn, html.cinematic .wish {
  background: linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04) 60%), var(--glass-tint) !important;
  border-color: rgba(255, 255, 255, .22) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .35), inset 0 -8px 14px -6px rgba(0, 0, 0, .35), 0 8px 20px rgba(0, 0, 0, .45) !important;
}
html.cinematic .perk > span::before, html.cinematic .glass-icon::before, html.cinematic .icon-btn::before { opacity: .35; }

@media (prefers-reduced-motion: reduce) {
  .pvisual::after, .char-pic::after { animation: none !important; }
  .perk > span::after, .glass-icon::after, .icon-btn::after, .logo-mark::after { transition: none; }
}
@media (max-width: 760px) {
  .glass-icon { width: 62px; height: 62px; border-radius: 20px; }
  .glass-icon .cat-emoji { font-size: 1.9rem; }
  .perk > span { width: 44px; height: 44px; border-radius: 15px; }
}
