/* Цвета и шрифт наследуются от бренда; геометрия одинакова в корзине и на телефоне. */
.crmdv-shared-dialog {
    --sc-ink: var(--foreground, #1a1a4a);
    --sc-muted: var(--muted-foreground, #64728b);
    --sc-line: var(--border, #dde3ec);
    --sc-primary: var(--primary, #ff3399);
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    color: var(--sc-ink);
    background: var(--card, #fff);
    font: inherit;
    border: 0;
    border-radius: 24px;
    padding: 0;
    width: min(560px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    box-shadow: 0 24px 80px #0003;
}
.crmdv-shared-dialog[open] { display: flex; flex-direction: column; }
.crmdv-shared-dialog::backdrop { background: #10101b80; }
.crmdv-shared-dialog *, .crmdv-share-trigger { box-sizing: border-box; }
.crmdv-shared-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 24px 24px 20px; flex: 0 0 auto; border-bottom: 1px solid var(--sc-line);
}
.crmdv-shared-head h2 { font: inherit; font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0; color: inherit; }
.crmdv-shared-head p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--sc-muted); }
.crmdv-shared-dialog .crmdv-shared-close {
    flex: 0 0 36px; display: grid; place-items: center; width: 36px; height: 36px;
    padding: 0; border: 1px solid var(--sc-line); border-radius: 50%; background: transparent;
    color: var(--sc-ink); font: inherit; font-size: 28px; line-height: 1; cursor: pointer;
}
.crmdv-shared-content { padding: 0 24px; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.crmdv-shared-list { padding: 0; margin: 0; list-style: none; }
.crmdv-shared-item {
    display: flex; align-items: flex-start; gap: 14px; padding: 18px 0;
    border-bottom: 1px solid var(--sc-line); list-style: none;
}
.crmdv-shared-image { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 12px; object-fit: cover; background: var(--muted, #f0f5fa); }
.crmdv-shared-item-info { flex: 1; min-width: 0; }
.crmdv-shared-item-name { font: inherit; color: inherit; font-size: 16px; line-height: 1.4; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.crmdv-shared-item-options { margin: 5px 0 0; color: var(--sc-muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.crmdv-shared-item-side { flex: 0 0 auto; max-width: 110px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; font-size: 15px; white-space: nowrap; }
.crmdv-shared-item-quantity { color: var(--sc-muted); font-size: 13px; }
.crmdv-shared-item-unavailable { color: var(--destructive, #b42318); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.crmdv-shared-item.is-unavailable .crmdv-shared-item-name { color: var(--sc-muted); }
.crmdv-shared-total { display: flex; gap: 16px; justify-content: space-between; padding: 18px 0 0; font-size: 16px; }
.crmdv-shared-footnote { color: var(--sc-muted); font-size: 12px; line-height: 1.5; margin: 10px 0 18px; }
.crmdv-shared-actions {
    flex: 0 0 auto; padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 10px;
    border-top: 1px solid var(--sc-line); background: var(--card, #fff);
    max-height: 48dvh; overflow-y: auto;
}
.crmdv-shared-dialog .crmdv-shared-button, .crmdv-share-trigger {
    display: flex; align-items: center; justify-content: center; width: 100%;
    min-height: 48px; padding: 12px 18px; border: 1px solid var(--border, #dde3ec);
    border-radius: 14px; background: transparent; color: var(--foreground, #1a1a4a);
    font: inherit; font-weight: 600; font-size: 15px; line-height: 1.4; cursor: pointer;
    text-align: center; text-decoration: none;
}
.crmdv-shared-dialog .crmdv-shared-button.is-primary { background: var(--sc-primary); color: var(--primary-foreground, #fff); border-color: var(--sc-primary); }
.crmdv-shared-dialog .crmdv-shared-button.is-quiet { min-height: 36px; padding: 7px; border-color: transparent; font-weight: 400; color: var(--sc-muted); }
.crmdv-shared-dialog .crmdv-shared-button:disabled, .crmdv-shared-dialog .crmdv-shared-close:disabled { opacity: .55; cursor: wait; }
.crmdv-shared-dialog button:focus-visible, .crmdv-shared-dialog input:focus-visible, .crmdv-share-trigger:focus-visible { outline: 3px solid var(--primary, #ff3399); outline-offset: 3px; }
.crmdv-shared-actions .crmdv-shared-footnote { margin: 0; text-align: center; }
.crmdv-shared-current { margin: 0 0 2px; color: var(--sc-muted); font-size: 13px; line-height: 1.5; text-align: center; }
.crmdv-shared-notice, .crmdv-shared-error { background: var(--muted, #f0f5fa); color: var(--sc-ink); padding: 12px 14px; border-radius: 12px; margin: 16px 0; font-size: 14px; line-height: 1.5; }
.crmdv-shared-error { border: 1px solid var(--destructive, #b42318); }
.crmdv-shared-actions .crmdv-shared-inline-error { margin: 0 0 2px; }
.crmdv-shared-empty-note { font-size: 14px; line-height: 1.5; margin: 0; }
.crmdv-shared-explainer { font-size: 15px; line-height: 1.6; margin: 20px 0; }
.crmdv-shared-link-label { display: block; font-size: 13px; font-weight: 600; }
.crmdv-shared-dialog .crmdv-shared-link {
    font: inherit; font-size: 14px; display: block; width: 100%; border: 1px solid var(--sc-line);
    border-radius: 12px; padding: 13px 14px; margin: 8px 0 0; background: var(--muted, #f0f5fa); color: var(--sc-ink);
}
.crmdv-shared-loading { color: var(--sc-muted); padding: 30px 0; font-size: 15px; margin: 0; }
.crmdv-share-trigger { margin-top: 12px; min-height: 44px; font-size: 14px; }
.crmdv-cart-header-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.kh-cart-sidebar__header { gap: 10px; }
.kh-cart-sidebar__header .crmdv-cart-header-share {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: auto; min-height: 36px; margin: 0; padding: 6px 8px; border: 0;
    border-radius: 9px; background: transparent; color: var(--muted-foreground, #64728b);
    font: inherit; font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap; cursor: pointer;
}
.kh-cart-sidebar__header .crmdv-cart-header-share:hover { background: var(--muted, #f0f5fa); color: var(--foreground, #1a1a4a); }
.kh-cart-sidebar__header .crmdv-cart-header-share:focus-visible { outline: 3px solid var(--primary, #ff3399); outline-offset: 2px; }
.kh-cart-sidebar__header .crmdv-cart-header-share[hidden] { display: none; }
.crmdv-cart-header-share svg { flex: 0 0 18px; }
.crmdv-shared-toast {
    position: fixed; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
    max-width: calc(100vw - 32px); z-index: 2147483647; padding: 12px 18px; border-radius: 12px;
    background: var(--foreground, #1a1a4a); color: var(--card, #fff); font: inherit; font-size: 14px; line-height: 1.4;
    text-align: center; box-shadow: 0 5px 22px #0002;
}
.crmdv-shared-toast[hidden] { display: none; }
@media (max-width: 600px) {
    .crmdv-shared-dialog { width: 100%; max-height: calc(100dvh - 20px); margin: auto 0 0; border-radius: 24px 24px 0 0; }
    .crmdv-shared-head { padding: 22px 20px 16px; }
    .crmdv-shared-head h2 { font-size: 20px; }
    .crmdv-shared-content { padding: 0 20px; }
    .crmdv-shared-actions { padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 48dvh; }
    .crmdv-shared-image { width: 52px; height: 52px; flex-basis: 52px; }
    .crmdv-shared-item { gap: 10px; padding: 15px 0; }
    .crmdv-shared-item-name { font-size: 15px; }
    .crmdv-shared-item-side { font-size: 14px; max-width: 92px; }
}
@media (max-width: 360px) {
    .crmdv-shared-image { width: 42px; height: 42px; flex-basis: 42px; }
    .crmdv-shared-head, .crmdv-shared-actions { padding-left: 16px; padding-right: 16px; }
    .crmdv-shared-content { padding-left: 16px; padding-right: 16px; }
}

