:root { --smc-accent: #111; --smc-width: 380px; }
.smc-panel, .smc-panel *, .smc-btn { box-sizing: border-box; }

.smc-open {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	background: none; border: 0; padding: 8px; cursor: pointer; color: inherit; line-height: 1;
}
.smc-floating {
	position: fixed; right: 20px; bottom: 20px; z-index: 9998;
	width: 54px; height: 54px; border-radius: 50%;
	background: var(--smc-accent); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.smc-count {
	position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 10px; background: #e53935; color: #fff; font-size: 12px; line-height: 20px; text-align: center;
	box-sizing: border-box;
}
.smc-count.smc-empty { display: none; }

.smc-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99998;
	opacity: 0; visibility: hidden; transition: .25s;
}
.smc-panel {
	position: fixed; top: 0; right: 0; bottom: 0; width: var(--smc-width); max-width: 100%;
	background: #fff; color: #222; z-index: 99999; display: flex; flex-direction: column;
	transform: translateX(100%); visibility: hidden;
	transition: transform .3s, visibility 0s .3s; box-shadow: -4px 0 20px rgba(0,0,0,.15);
}
.smc-is-open .smc-overlay { opacity: 1; visibility: visible; }
.smc-is-open .smc-panel   { transform: none; visibility: visible; transition: transform .3s; }

.smc-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; font-size: 18px; }
.smc-close { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: #666; }

.smc-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.smc-no-items { padding: 40px 20px; text-align: center; color: #888; }
.smc-items { flex: 1; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0 20px; list-style: none; }
.smc-item { position: relative; display: flex; gap: 12px; padding: 14px 32px 14px 0; border-bottom: 1px solid #f0f0f0; }
.smc-item.smc-loading { opacity: .5; pointer-events: none; }
.smc-thumb { flex: none; }
.smc-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.smc-info { flex: 1; min-width: 0; font-size: 14px; }
.smc-name { display: block; font-weight: 600; text-decoration: none; color: inherit; margin-bottom: 4px; }
.smc-info dl.variation { margin: 0 0 4px; font-size: 12px; color: #777; }
.smc-info dl.variation dt, .smc-info dl.variation dd, .smc-info dl.variation p { display: inline; margin: 0; }
.smc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.smc-qty { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 6px; }
.smc-qty button { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 16px; }
.smc-qty-val { min-width: 24px; text-align: center; }
.smc-remove { position: absolute; top: 8px; right: -6px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; font-size: 22px; line-height: 1; color: #aaa; cursor: pointer; }
.smc-remove:hover { color: #e53935; }

.smc-footer { padding: 16px 20px 20px; border-top: 1px solid #eee; display: grid; gap: 10px; }
.smc-subtotal { display: flex; justify-content: space-between; font-size: 16px; }
.smc-btn {
	display: block; text-align: center; padding: 12px; border-radius: 6px; text-decoration: none;
	background: var(--smc-accent); color: #fff; border: 1px solid var(--smc-accent);
}
.smc-btn-light { background: #fff; color: var(--smc-accent); }
body.smc-is-open { overflow: hidden; }

.smc-qty button:disabled { opacity: .35; cursor: not-allowed; }

.smc-notice { display: none; margin: 10px 20px 0; padding: 8px 12px; border-radius: 6px; background: #fff4e5; color: #8a4b00; font-size: 13px; }
.smc-notice.smc-show { display: block; }

/* Фокус с клавиатуры */
.smc-open:focus-visible, .smc-close:focus-visible, .smc-qty button:focus-visible,
.smc-remove:focus-visible, .smc-btn:focus-visible, .smc-name:focus-visible {
	outline: 2px solid #2271b1; outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.smc-panel, .smc-overlay { transition: none !important; }
}
