
.gmg-sw-form .gmg-sw-select { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.gmg-sw {
    --sw-size: 40px;
    --sw-accent: var(--e-global-color-primary, #6d28d9);
    --sw-border: #e2e8f0;
    --sw-bg: #fff;
    --sw-text: #1e293b;
    --sw-radius: 10px;
    --sw-ease: cubic-bezier(.34, 1.56, .64, 1);
    display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0;
}
.gmg-sw--circle { --sw-radius: 999px; }
.gmg-sw--square { --sw-radius: 4px; }

.gmg-sw__item {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-width: var(--sw-size); height: var(--sw-size); padding: 0 14px; margin: 0;
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1; color: var(--sw-text);
    background: var(--sw-bg); border: 2px solid var(--sw-border); border-radius: var(--sw-radius);
    cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    transition: transform .25s var(--sw-ease), border-color .2s, box-shadow .25s, background .2s, color .2s, opacity .2s;
    -webkit-tap-highlight-color: transparent;
}
.gmg-sw__item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--sw-accent) 45%, var(--sw-border)); box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .25); }
.gmg-sw__item:active { transform: scale(.94); }
.gmg-sw__item:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-accent) 35%, transparent); }

.gmg-sw__item.is-on {
    border-color: var(--sw-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-accent) 18%, transparent), 0 8px 20px -8px color-mix(in srgb, var(--sw-accent) 60%, transparent);
    animation: gmg-sw-pop .35s var(--sw-ease);
}


.gmg-sw--button .gmg-sw__item.is-on,
.gmg-sw--size .gmg-sw__item.is-on { background: var(--sw-accent); color: #fff; }
.gmg-sw--size .gmg-sw__item { padding: 0 10px; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }


.gmg-sw--color .gmg-sw__item,
.gmg-sw--image .gmg-sw__item { width: var(--sw-size); padding: 3px; }
.gmg-sw__swatch { display: block; width: 100%; height: 100%; border-radius: calc(var(--sw-radius) - 4px); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .3s var(--sw-ease); }
.gmg-sw--circle .gmg-sw__swatch { border-radius: 999px; }
.gmg-sw__swatch img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0 !important; }
.gmg-sw__swatch--text { display: flex; align-items: center; justify-content: center; font-size: 12px; background: #f1f5f9; }
.gmg-sw--color .gmg-sw__item.is-on .gmg-sw__swatch,
.gmg-sw--image .gmg-sw__item.is-on .gmg-sw__swatch { transform: scale(.86); }
.gmg-sw--color .gmg-sw__item::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 40%; height: 22%;
    border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-15%) rotate(-45deg) scale(0);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); transition: transform .3s var(--sw-ease); pointer-events: none;
}
.gmg-sw--color .gmg-sw__item.is-on::after { transform: translateY(-15%) rotate(-45deg) scale(1); }


.gmg-sw--radio { flex-direction: column; gap: 8px; }
.gmg-sw--radio .gmg-sw__item { justify-content: flex-start; width: 100%; height: auto; min-height: var(--sw-size); padding: 10px 14px; text-align: start; }
.gmg-sw__dot { position: relative; flex: none; width: 18px; height: 18px; border: 2px solid var(--sw-border); border-radius: 50%; transition: border-color .2s; }
.gmg-sw__dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--sw-accent); transform: scale(0); transition: transform .3s var(--sw-ease); }
.gmg-sw--radio .gmg-sw__item.is-on { background: color-mix(in srgb, var(--sw-accent) 7%, #fff); }
.gmg-sw--radio .gmg-sw__item.is-on .gmg-sw__dot { border-color: var(--sw-accent); }
.gmg-sw--radio .gmg-sw__item.is-on .gmg-sw__dot::after { transform: scale(1); }


.gmg-sw__item.is-off { opacity: .45; }
.gmg-sw__item.is-off::before {
    content: ""; position: absolute; inset: 50% -10% auto; height: 2px; background: #ef4444;
    transform: rotate(-24deg); border-radius: 2px; pointer-events: none; z-index: 1;
}
.gmg-sw__item.is-off:hover { opacity: .7; }
.gmg-sw__item.is-shake { animation: gmg-sw-shake .4s; }


.gmg-sw-tip {
    position: absolute; z-index: 99999; top: 0; left: 0; padding: 6px 10px; max-width: 220px;
    font-size: 12px; line-height: 1.6; color: #fff; background: #0f172a; border-radius: 8px;
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, .45); pointer-events: none; white-space: nowrap;
    opacity: 0; transform: translate(-50%, calc(-100% - 4px)); transition: opacity .18s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.gmg-sw-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: #0f172a; }
.gmg-sw-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); }
.gmg-sw-tip small { display: block; color: #fca5a5; }


.gmg-sw__ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: gmg-sw-ripple .6s ease-out forwards; pointer-events: none; }


.gmg-sw-current { display: inline-block; margin-inline-start: 6px; font-weight: 400; color: var(--e-global-color-text, #64748b); opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .3s var(--sw-ease, ease); }
.gmg-sw-current.is-on { opacity: 1; transform: none; }
.gmg-sw-current.is-on::before { content: ": "; }


.gmg-sw.is-enter .gmg-sw__item { animation: gmg-sw-in .45s var(--sw-ease) both; }
.gmg-sw.is-enter .gmg-sw__item.is-on { animation: gmg-sw-in .45s var(--sw-ease) both; }


.gmg-sw-form table.variations td.value { padding-block: 6px; }
.gmg-sw-form .reset_variations { display: inline-block; margin-top: 8px; font-size: 13px; }

@keyframes gmg-sw-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes gmg-sw-in { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes gmg-sw-ripple { to { transform: scale(1); opacity: 0; } }
@keyframes gmg-sw-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
    .gmg-sw *, .gmg-sw *::before, .gmg-sw *::after, .gmg-sw-current, .gmg-sw-tip { animation: none !important; transition: none !important; }
}
