/*
 * save-watch.css - Save (heart), Notify of changes (bell) and the "Saved" popup.
 * Loaded on every page by _Layout with Includes/js/save-watch.js.
 */

/* Two labels per button; the state class picks one. */
[data-sw] [data-sw-on] { display: none; }
[data-sw].is-on [data-sw-on] { display: inline; }
[data-sw].is-on [data-sw-off] { display: none; }

.sw-ico { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-sw="save"].is-on .sw-ico { fill: #e0245e; stroke: #e0245e; }
[data-sw="watch"].is-on .sw-ico { fill: currentColor; }
.btn-sm[data-sw="watch"].is-on { border-color: #8a3995; color: #8a3995; background: #faf8fb; }
.btn-sm .sw-ico { width: 15px; height: 15px; }

/* Standard listing sidebar: the two buttons share one row. */
.sw-pair { display: flex; gap: 8px; margin-bottom: 10px; }
.sw-pair .btn { flex: 1 1 0; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; padding-right: 8px; }
.sw-pair .btn.is-on[data-sw="watch"] { border-color: #8a3995; color: #8a3995; background: #faf8fb; }
.sw-pair .sw-save { flex: 0 0 auto; }
.sw-pair .sw-save:only-child { flex: 1 1 auto; }

/* Showcase side card (Partials/Showcase/_Showcase.cshtml) */
.sc-card .sw-pair { margin: 8px 0 0; }
.sw-pair .sc-btn { text-align: center; padding-left: 12px; padding-right: 12px; }
.sc-card .sw-pair .sc-btn + .sc-btn { margin-top: 0; }
.sw-pair .sc-btn:not(.sw-save) { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sw-pair .sc-btn.is-on[data-sw="watch"] { border-color: #8a3995; color: #8a3995 !important; background: #faf8fb; }

/* Search and home cards: a round heart in the price row. */
.sw-heart {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border: 1px solid #e5e7eb; border-radius: 50%;
    background: #fff; color: #374151; cursor: pointer; line-height: 1;
    transition: transform .12s ease, border-color .12s ease;
}
.sw-heart:hover { border-color: #9ca3af; }
.sw-heart:active { transform: scale(.92); }
.sw-heart:focus-visible { outline: 2px solid #8a3995; outline-offset: 2px; }
.sw-heart .sw-ico { width: 18px; height: 18px; vertical-align: 0; }
.inventory-bottom .sw-heart { margin-left: 10px; vertical-align: middle; }

/* Popup */
.sw-pop-wrap {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(17, 24, 39, .35);
}
.sw-pop-wrap[hidden] { display: none; }
.sw-pop {
    position: relative; width: 100%; max-width: 380px; padding: 22px 22px 18px;
    background: #fff; border-radius: 14px; box-shadow: 0 18px 48px rgba(17, 24, 39, .25);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #111827;
}
.sw-pop-x {
    position: absolute; top: 8px; right: 10px; width: 34px; height: 34px;
    border: 0; background: none; font-size: 26px; line-height: 1; color: #6b7280; cursor: pointer; border-radius: 50%;
}
.sw-pop-x:hover { background: #f3f4f6; color: #111827; }
.sw-pop-head { display: flex; align-items: center; gap: 10px; margin: 0 30px 8px 0; font-size: 20px; }
.sw-pop-icon { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; background: #f3f4f6 center / 18px no-repeat; }
.sw-pop.is-saved .sw-pop-icon {
    background-color: #fde8ee;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e0245e'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1 1.1L12 21.3l7.8-7.8 1-1.1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E");
}
.sw-pop.is-error .sw-pop-icon { background-color: #fee2e2; }
.sw-pop-text { margin: 0 0 14px; font-size: 15px; color: #4b5563; }
.sw-pop-note { margin: -4px 0 12px; font-size: 13px; color: #92400e; background: #fffbeb; border-radius: 8px; padding: 8px 10px; }
.sw-pop-note[hidden] { display: none; }
.sw-pop-link {
    display: block; margin-top: 4px; padding: 11px 14px; border-radius: 8px; text-align: center;
    background: #8a3995; color: #fff; font-weight: 600; font-size: 15px;
}
.sw-pop-link:hover, .sw-pop-link:focus { background: #742f7e; color: #fff; text-decoration: none; }
.sw-pop.is-error .sw-pop-link { display: none; }

/* Email switch */
.sw-switch { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 500; font-size: 14px; color: #111827; cursor: pointer; }
.sw-switch[hidden] { display: none; }
.sw-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-switch-track {
    position: relative; flex: 0 0 40px; width: 40px; height: 24px; border-radius: 12px;
    background: #d1d5db; transition: background .15s ease;
}
.sw-switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease;
}
.sw-switch-input:checked + .sw-switch-track { background: #8a3995; }
.sw-switch-input:checked + .sw-switch-track::after { transform: translateX(16px); }
.sw-switch-input:focus-visible + .sw-switch-track { outline: 2px solid #8a3995; outline-offset: 2px; }

@media (max-width: 600px) {
    .sw-pop-wrap { align-items: flex-end; padding: 0; }
    .sw-pop { max-width: none; border-radius: 16px 16px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
