/* Віджет «В кошику N товарів» (модуль «Віджет кошика»). Кольори — змінні теми oct_deals. */
.cw {
    --cw-accent: var(--ds-primary-color, #00A8E8);
    --cw-text: var(--ds-dark-text-color, #1d2433);
    --cw-muted: var(--ds-light-text-color, #7a8291);
    --cw-border: var(--ds-border-color, #e3e7ee);
    --cw-surface: var(--ds-white-color, #fff);
    --cw-soft: var(--ds-light-bg-color, #f5f7fa);
    margin: 0 0 16px;
}
.cw.cw-empty,
.cw.cw-hidden { display: none; }

.cw-card {
    display: flex; align-items: center; gap: 16px 28px; padding: 18px 24px;
    border: 1px solid color-mix(in srgb, var(--cw-border) 75%, transparent); border-radius: 18px; background: var(--cw-surface);
    animation: cw-in .25s ease-out;
}
@keyframes cw-in { from { opacity: 0; transform: translateY(6px); } }

.cw-info { flex: 0 0 auto; min-width: 0; }
.cw-title { color: var(--cw-text); font-size: 22px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.cw-title span { color: var(--cw-accent); }
.cw-sum { margin-top: 4px; color: var(--cw-muted); font-size: 14px; }

.cw-items { display: flex; flex: 1 1 auto; align-items: center; gap: 12px; min-width: 0; padding: 8px 4px; overflow-x: auto; scrollbar-width: none; }
.cw-items::-webkit-scrollbar { display: none; }
.cw-item { position: relative; flex: 0 0 72px; width: 72px; height: 72px; }
.cw-item a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 6px; border: 1px solid var(--cw-border); border-radius: 12px; background: var(--cw-surface); transition: border-color .15s; box-sizing: border-box; }
.cw-item a:hover { border-color: var(--cw-accent); }
.cw-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cw-qty { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 6px; background: var(--cw-text); color: var(--cw-surface); font-size: 11px; font-weight: 700; line-height: 1.4; }
.cw-remove {
    position: absolute; top: -7px; right: -7px; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
    border: 1px solid var(--cw-border); border-radius: 50%; background: var(--cw-surface); color: var(--cw-muted);
    box-shadow: 0 2px 6px rgba(16, 24, 40, .1); cursor: pointer; transition: color .15s, border-color .15s;
}
.cw-remove svg { width: 12px; height: 12px; }
.cw-remove:hover { border-color: #e5484d; color: #e5484d; }
.cw-item.is-removing { opacity: .35; pointer-events: none; transition: opacity .2s; }
.cw-more {
    flex: 0 0 72px; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px;
    border-radius: 12px; background: var(--cw-soft); color: var(--cw-text) !important; font-size: 16px; font-weight: 700; text-decoration: none;
}

.cw-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 20px; margin-left: auto; }
.cw-link { color: var(--cw-accent) !important; font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 1.5px dashed currentColor; line-height: 1.3; white-space: nowrap; }
.cw-link:hover { border-bottom-style: solid; }
.cw-checkout {
    display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 28px; border-radius: 14px;
    background: var(--cw-accent); color: #fff !important; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap;
    box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--cw-accent) 75%, transparent); transition: filter .15s, transform .15s;
}
.cw-checkout:hover { filter: brightness(.94); transform: translateY(-1px); }
.cw-close { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--cw-muted); cursor: pointer; transition: background .15s, color .15s; }
.cw-close svg { width: 18px; height: 18px; }
.cw-close:hover { background: var(--cw-soft); color: var(--cw-text); }

@media (max-width: 991.98px) {
    .cw-card { flex-wrap: wrap; padding: 16px; }
    .cw-info { flex: 1 1 auto; }
    .cw-items { order: 3; flex-basis: 100%; }
    .cw-actions { order: 4; flex-basis: 100%; gap: 12px; }
    .cw-checkout { flex: 1 1 auto; }
    .cw-close { position: absolute; top: 10px; right: 10px; }
    .cw-card { position: relative; }
    .cw-title { padding-right: 32px; font-size: 19px; white-space: normal; }
}
@media (max-width: 575.98px) {
    .cw-item, .cw-more { flex-basis: 60px; width: 60px; height: 60px; }
    .cw-checkout { height: 48px; padding: 0 16px; font-size: 14px; }
}
