/* Savorita — My Savorita (dashboard cliente) */
.savorita-my-savorita {
    --sw-ms-accent: #d63638;
    --sw-ms-cw-d: 152px; --sw-ms-cw-t: 132px; --sw-ms-cw-m: 104px;
    --sw-ms-radius: 12px;
    position: relative;
    display: flex; flex-direction: column; gap: 26px;
    box-sizing: border-box;
}
.savorita-my-savorita *, .savorita-my-savorita *::before, .savorita-my-savorita *::after { box-sizing: border-box; }

/* ===== Blocco produttore ===== */
.sw-ms-group { border: 1px solid #ececec; border-radius: var(--sw-ms-radius); background: #fff; padding: 16px; }
.sw-ms-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sw-ms-logo { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; }
.sw-ms-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-ms-logo-ph { background: var(--sw-ms-accent); color: #fff; font-weight: 600; font-size: 13px; text-transform: uppercase; }
.sw-ms-group-title { margin: 0; font-size: 18px; font-weight: 700; }

/* ===== Carousel ===== */
.sw-ms-carousel { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.sw-ms-carousel::-webkit-scrollbar { height: 8px; }
.sw-ms-carousel::-webkit-scrollbar-thumb { background: #ddd; border-radius: 8px; }

.sw-ms-card {
    position: relative; flex: 0 0 var(--sw-ms-cw-d); width: var(--sw-ms-cw-d);
    scroll-snap-align: start; border: 1px solid #e6e6e6; border-radius: 10px; padding: 8px; background: #fff; text-align: center;
    transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.sw-ms-card.is-draft { border-color: var(--sw-ms-accent); background: #faf1f1; background: color-mix(in srgb, var(--sw-ms-accent) 8%, transparent); }
.sw-ms-card.is-out { background: #f4f4f4; border-color: #e6e6e6; opacity: .92; }
.sw-ms-card.is-out .sw-ms-thumb img { filter: grayscale(.35); opacity: .85; }
.sw-ms-thumb { display: block; line-height: 0; }
.sw-ms-thumb img { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; display: block; }
.sw-ms-card-name { font-size: 12px; font-weight: 600; line-height: 1.25; margin-top: 8px; color: #222; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-ms-card-price { font-size: 12px; color: #444; margin-top: 2px; }
.sw-ms-card-price ins { text-decoration: none; }
.sw-ms-card-cat { font-size: 11px; color: #999; margin-top: 1px; }

/* Cuore preferiti (sinistra) + toggle richiesta (destra) */
.sw-ms-heart, .sw-ms-toggle { position: absolute; top: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; padding: 0; }
.sw-ms-heart { left: 6px; background: #fff; color: var(--sw-ms-accent); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sw-ms-heart-svg { width: 16px; height: 16px; fill: currentColor; }
.sw-ms-heart.lock { color: #bcbcbc; cursor: not-allowed; }
.sw-ms-toggle { right: 6px; background: var(--sw-ms-accent); color: #fff; font-size: 18px; line-height: 1; }
.sw-ms-card.is-out .sw-ms-toggle { background: #8a8a8a; }
.sw-ms-toggle[disabled], .sw-ms-heart[disabled] { opacity: .6; cursor: wait; }

/* Card "esplora / add more" */
.sw-ms-explore { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: #555; border-style: dashed; border-color: #cfcfcf; background: #fafafa; font-size: 12px; text-align: center; line-height: 1.3; }
.sw-ms-explore:hover { border-color: var(--sw-ms-accent); color: var(--sw-ms-accent); }
.sw-ms-explore-plus { font-size: 26px; line-height: 1; }

/* ===== Tabella draft ===== */
.sw-ms-draft { margin-top: 12px; }
.sw-ms-req-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #999; font-weight: 600; margin: 6px 2px; }
.sw-ms-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sw-ms-table thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #999; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #eee; }
.sw-ms-table th.sw-ms-th-num { text-align: right; }
.sw-ms-table td { padding: 8px; border-bottom: 1px solid #f2f2f2; vertical-align: middle; }
.sw-ms-num { text-align: right; white-space: nowrap; }
.sw-ms-row { display: none; }
.sw-ms-row.is-draft { display: table-row; }
.sw-ms-r-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.sw-ms-r-name a { color: #222; text-decoration: none; font-weight: 600; }
.sw-ms-r-name a:hover { color: var(--sw-ms-accent); }
.sw-ms-r-sku { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.sw-ms-r-cat { color: #666; }
.sw-ms-qty { width: 76px; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; text-align: center; font: inherit; }
.sw-ms-remove { width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer; background: #f0f0f0; color: #777; display: inline-flex; align-items: center; justify-content: center; transition: background-color .2s, color .2s; }
.sw-ms-remove:hover { background: var(--sw-ms-accent); color: #fff; }

/* ===== Riepilogo (totali a sinistra, CTA a destra) ===== */
.sw-ms-empty-draft { display: none; padding: 14px; color: #888; text-align: center; background: #fafafa; border-radius: 8px; margin-top: 8px; }
.sw-ms-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 14px; padding: 14px; border-radius: 10px; background: #fafafa; border: 1px solid #eee; }
.sw-ms-sum-lines { display: flex; flex-direction: column; gap: 4px; font-size: 14px; min-width: 260px; }
.sw-ms-sum-line { display: flex; gap: 16px; justify-content: space-between; }
.sw-ms-sum-line > span:first-child { color: #666; }
.sw-ms-cta { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; text-align: right; max-width: 300px; }
.sw-ms-hint { font-size: 13px; color: #666; }
.sw-ms-send { border: 0; cursor: pointer; padding: 12px 20px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #fff; background: var(--sw-ms-accent); transition: transform .12s ease, opacity .2s ease; }
.sw-ms-send:hover { transform: translateY(-1px); }
.sw-ms-send[disabled] { opacity: .5; cursor: not-allowed; }
.sw-ms-send.is-sent { background: #1d9e75; }

.sw-ms-locked { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: #fff8e5; border: 1px solid #f0d98c; }
.sw-ms-locked-text { font-size: 13px; color: #7a5c00; }
.sw-ms-locked-cta { font-size: 13px; font-weight: 700; text-decoration: none; color: #fff; background: var(--sw-ms-accent); padding: 7px 12px; border-radius: 8px; }

.sw-ms-group.sw-ms-is-empty .sw-ms-table, .sw-ms-group.sw-ms-is-empty .sw-ms-summary { display: none; }
.sw-ms-group.sw-ms-is-empty .sw-ms-empty-draft { display: block; }

/* ===== Modale di conferma ===== */
.sw-ms-ov { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.sw-ms-ov.on { display: flex; }
.sw-ms-dlg { background: #fff; border-radius: 12px; padding: 20px; max-width: 380px; width: 100%; border: 1px solid #eaeaea; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.sw-ms-dlg-t { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.sw-ms-dlg-b { margin: 0 0 14px; font-size: 14px; color: #555; line-height: 1.5; }
.sw-ms-ask { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #666; margin-bottom: 14px; }
.sw-ms-dlg-btns { display: flex; gap: 8px; justify-content: flex-end; }
.sw-ms-b { padding: 9px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1px solid #d0d0d0; background: #fff; color: #222; }
.sw-ms-ok { border: 0; background: var(--sw-ms-accent); color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 1024px) { .sw-ms-card { flex-basis: var(--sw-ms-cw-t); width: var(--sw-ms-cw-t); } }
@media (max-width: 640px) {
    .sw-ms-card { flex-basis: var(--sw-ms-cw-m); width: var(--sw-ms-cw-m); }
    .sw-ms-table thead { display: none; }
    .sw-ms-row.is-draft { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f2f2f2; }
    .sw-ms-table td { border: 0; padding: 2px 4px; }
    .sw-ms-r-thumb { grid-row: span 3; }
    .sw-ms-r-cat, .sw-ms-num { color: #777; font-size: 12px; text-align: left; }
    .sw-ms-r-actions { grid-row: 1; grid-column: 3; }
    .sw-ms-summary { flex-direction: column; align-items: stretch; }
    .sw-ms-cta { align-items: stretch; text-align: left; max-width: none; }
    .sw-ms-send { width: 100%; }
}
