/* =====================================================================
   Shuvino UX polish layer — perceived performance & micro-interactions
   (toasts, skeletons, image fade-in, button loading, press states)
   Loaded on BOTH storefront and dashboard, after the design system.
   ===================================================================== */

/* ---------- Skeleton shimmer (reusable) ---------- */
@keyframes sh-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sh-skeleton {
    background: linear-gradient(100deg, #eef1f6 30%, #f7f9fc 50%, #eef1f6 70%);
    background-size: 200% 100%;
    animation: sh-shimmer 1.3s linear infinite;
    border-radius: var(--sh-r-sm, 10px);
    color: transparent !important;
}
@media (prefers-reduced-motion: reduce) { .sh-skeleton { animation: none; } }

/* ---------- Image fade-in + card-media skeleton ---------- */
/* JS tags loading images with .sh-imgload, adds .is-loaded on load/error. */
img.sh-imgload { opacity: 0; transition: opacity .45s var(--sh-ease, cubic-bezier(.22,1,.36,1)); }
img.sh-imgload.is-loaded { opacity: 1; }

/* Shimmer skeleton BEHIND product/group card thumbnails while they load.
   Uses the media element's own background (behind every child, incl. absolutely
   positioned badges/wish button) so there are no z-index/stacking conflicts.
   A loaded image (object-fit:cover) fully covers it; .is-ready just halts the anim. */
.sh-card__media {
    background: linear-gradient(100deg, #eef1f6 30%, #f6f8fb 50%, #eef1f6 70%);
    background-size: 200% 100%; animation: sh-shimmer 1.3s linear infinite;
}
.sh-card__media.is-ready { background: var(--sh-bg-soft, #f1f3f7); animation: none; }
@media (prefers-reduced-motion: reduce) { .sh-card__media { animation: none; } }

/* ---------- Button loading state ---------- */
.sh-btn.is-loading { pointer-events: none; opacity: .82; }
.sh-btn.is-loading::before {
    content: ""; width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px;
    display: inline-block; border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: sh-spin .6s linear infinite;
}
@keyframes sh-spin { to { transform: rotate(360deg); } }

/* ---------- Micro-interactions: tactile press ---------- */
.sh-btn, .sh-tact a, .sh-tact button, .sh-navlink, .sh-card__wish {
    transition: transform var(--sh-fast, .18s) var(--sh-ease, ease), box-shadow var(--sh-fast, .18s) ease, background var(--sh-fast, .18s) ease, color var(--sh-fast, .18s) ease, border-color var(--sh-fast, .18s) ease;
}
.sh-btn:active:not(.is-loading) { transform: translateY(1px) scale(.985); }
.sh-tact a:active, .sh-tact button:active { transform: scale(.9); }
.sh-card__wish:active { transform: scale(.85); }

/* Wishlist heart pop when toggled on */
@keyframes sh-heart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.sh-card__wish.is-active i { animation: sh-heart-pop .38s var(--sh-ease, ease); }

/* Keyboard focus visibility (accessibility polish) */
.sh-btn:focus-visible, .sh-navlink:focus-visible, .sh-select:focus-visible,
input:focus-visible, textarea:focus-visible, .sh-tact a:focus-visible {
    outline: 2px solid var(--sh-blue, #123B93); outline-offset: 2px;
}

/* ---------- Legal / policy pages ---------- */
.sh-legal h3 { margin: 28px 0 8px; font-size: 1.12rem; font-weight: 800; color: var(--sh-ink, #222); }
.sh-legal p, .sh-legal li { color: var(--sh-ink-soft, #4B5563); line-height: 1.75; }
.sh-legal ul, .sh-legal ol { margin: 4px 0 10px 1.15rem; display: flex; flex-direction: column; gap: 7px; }
.sh-legal a { color: var(--sh-blue, #123B93); text-decoration: underline; }
.sh-legal > p:first-of-type { font-size: 1.02rem; }

/* ---------- Emoji user avatars (replace photographic user images) ---------- */
.sh-eava {
    display: inline-grid; place-items: center; flex: none; line-height: 1; user-select: none;
    border-radius: 50%; background: linear-gradient(135deg, #EAF0FB 0%, #E6F6F5 100%);
    box-shadow: inset 0 0 0 1px rgba(18, 59, 147, .06);
}
.sh-eava--xs { width: 24px; height: 24px; font-size: 13px; }
.sh-eava--sm { width: 36px; height: 36px; font-size: 19px; }
.sh-eava--md { width: 46px; height: 46px; font-size: 24px; }
.sh-eava--lg { width: 72px; height: 72px; font-size: 38px; }
/* Overlapping avatar stacks (group members) */
.sh-avatars .sh-eava { margin-left: -10px; border: 2px solid #fff; box-shadow: var(--sh-shadow-xs); }
.sh-avatars .sh-eava:first-child { margin-left: 0; }
.sh-avatars .sh-eava { width: 32px; height: 32px; font-size: 17px; }
.sh-avatars--lg .sh-eava { width: 34px; height: 34px; font-size: 18px; }
.sh-card__group .sh-avatars .sh-eava { width: 22px; height: 22px; font-size: 12px; }
/* Review avatars use the emoji circle in place of .sh-review__av img */
.sh-review .sh-eava { align-self: flex-start; }
/* Group-member cards (group buy page) use a larger circle */
.sh-member .sh-eava { width: 54px; height: 54px; font-size: 28px; border: 2px solid #fff; box-shadow: var(--sh-shadow-xs); }

/* ---------- Staff module-access checkboxes ---------- */
.sh-modgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sh-modchk {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer;
    border: 1px solid var(--sh-line); border-radius: 10px; font-size: .84rem; font-weight: 600;
    background: #fff; transition: all var(--sh-fast, .18s);
}
.sh-modchk:hover { border-color: var(--sh-teal); background: var(--sh-teal-50); }
.sh-modchk input { width: 16px; height: 16px; accent-color: var(--sh-teal); flex: none; }
.sh-modchk:has(input:checked) { border-color: var(--sh-teal); background: var(--sh-teal-50); color: var(--sh-teal-600); }
.sh-staffedit summary { list-style: none; }
.sh-staffedit summary::-webkit-details-marker { display: none; }
.sh-staffedit[open] summary { margin-bottom: 2px; }

/* ---------- Customer ID card ---------- */
.sh-idcard {
    display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
    padding: 14px 18px; border-radius: var(--sh-r, 16px);
    background: linear-gradient(120deg, #EAF0FB 0%, #E6F6F5 100%);
    border: 1px solid #DCE6F6;
}
.sh-idcard__ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sh-grad-brand, #123B93); color: #fff; font-size: 1.3rem; flex: none; }
.sh-idcard__meta { display: flex; flex-direction: column; line-height: 1.25; }
.sh-idcard__label { font-size: .74rem; font-weight: 700; color: var(--sh-ink-soft, #4B5563); text-transform: uppercase; letter-spacing: .03em; }
.sh-idcard__code { font-size: 1.18rem; font-weight: 800; color: var(--sh-blue, #123B93); letter-spacing: .04em; }
.sh-idcard__copy { margin-left: auto; }

/* ---------- Extra toast variant ---------- */
.sh-toast--warning { border-color: var(--sh-warning, #F59E0B); }
.sh-toast--warning .sh-toast__icon { background: var(--sh-warning, #F59E0B); }

/* Toasts never overlap a fixed header on small screens */
@media (max-width: 560px) { .sh-toast-wrap { top: 14px; right: 10px; left: 10px; } .sh-toast { min-width: 0; max-width: none; } }
