/* Магазин клуба: витрина, корзина, товар, продажи */
.shop {
    --shop-blue: var(--crm-blue, #1677ff);
    --shop-ink: var(--crm-ink, rgba(0, 0, 0, .88));
    --shop-muted: var(--crm-muted, rgba(0, 0, 0, .45));
    --shop-line: var(--crm-line, #e6edf4);
    --shop-card: var(--surface, #fff);
    --shop-well: var(--crm-well, #f8fafc);
    --shop-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--shop-ink);
}

/* tabs */
.shop-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-tab {
    padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
    color: var(--shop-muted); text-decoration: none; transition: background .15s, color .15s;
}
.shop-tab:hover { background: var(--crm-hover, #f7faff); color: var(--shop-ink); }
.shop-tab.is-active { background: var(--shop-card); color: var(--shop-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.shop-add-btn {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px; background: var(--shop-blue); color: #fff;
    font-weight: 600; font-size: 14px; text-decoration: none; box-shadow: 0 4px 12px rgba(22, 119, 255, .25);
    transition: transform .15s, box-shadow .15s;
}
.shop-add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22, 119, 255, .3); color: #fff; }
.shop-add-btn svg { width: 16px; height: 16px; }

/* head */
.shop-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop-head:empty { display: none; }
.shop-branch { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--shop-muted); }
.shop-branch select, .shop-filters select {
    height: 38px; padding: 0 12px; border: 1px solid var(--shop-line); border-radius: 10px;
    background: var(--shop-card); font-size: 14px; color: var(--shop-ink);
}
.shop-today {
    margin-left: auto; display: flex; flex-direction: column; align-items: flex-end;
    font-size: 12px; color: var(--shop-muted);
}
.shop-today strong { font-size: 18px; color: var(--shop-ink); }

.shop-banner {
    padding: 12px 16px; border-radius: 12px; background: var(--crm-soft, #e6f4ff);
    color: var(--crm-soft-ink, #0958d9); font-size: 14px;
}
.shop-banner--warn { background: #fff7e6; color: #ad6800; }
.shop-banner a { margin-left: 8px; font-weight: 600; color: inherit; }
.shop-banner--app {
    display: flex; align-items: center; gap: 6px; text-decoration: none;
    background: #fffbe6; color: #ad6800; border: 1px solid #ffe58f;
}
.shop-banner--app span { margin-left: auto; font-weight: 600; }

/* filters */
.shop-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.shop-search {
    position: relative; flex: 1 1 260px; max-width: 360px; display: flex; align-items: center;
}
.shop-search svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--shop-muted); pointer-events: none; }
.shop-search input {
    width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--shop-line);
    border-radius: 10px; background: var(--shop-card); font-size: 14px;
}
.shop-search input:focus, .shop-field input:focus, .shop-field select:focus, .shop-field textarea:focus {
    outline: none; border-color: var(--shop-blue); box-shadow: 0 0 0 3px var(--crm-blue-soft, rgba(22, 119, 255, .12));
}
.shop-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-chip {
    padding: 7px 14px; border: 1px solid var(--shop-line); border-radius: 999px; background: var(--shop-card);
    font-size: 13px; color: var(--shop-ink); cursor: pointer; transition: all .15s;
}
.shop-chip:hover { border-color: var(--shop-blue); color: var(--shop-blue); }
.shop-chip.is-active { background: var(--shop-ink); border-color: var(--shop-ink); color: #fff; }

/* layout */
.shop-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.shop-layout.has-cart { grid-template-columns: minmax(0, 1fr) 320px; }

.shop-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}
.shop-card {
    display: flex; flex-direction: column; background: var(--shop-card); border: 1px solid var(--shop-line);
    border-radius: var(--shop-radius); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.shop-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.shop-card.in-cart { border-color: var(--shop-blue); box-shadow: 0 0 0 2px var(--crm-blue-soft, rgba(22, 119, 255, .12)); }
.shop-card.is-out .shop-card-media img, .shop-card.is-hidden-product .shop-card-media img { filter: grayscale(.7); opacity: .6; }
.shop-card[hidden] { display: none; }
.shop-card-media {
    position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #f0f5ff, #f8fafc);
    display: flex; align-items: center; justify-content: center;
}
.shop-card-media img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-ph { font-size: 44px; font-weight: 700; color: rgba(22, 119, 255, .35); }
.shop-badge {
    position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.shop-badge--out { color: #cf1322; }
.shop-badge--low { color: #ad6800; }
.shop-badge--muted { color: var(--shop-muted); }
.shop-card-edit {
    position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .92);
    color: var(--shop-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); opacity: 0; transition: opacity .15s;
}
.shop-card:hover .shop-card-edit, .shop-card-edit:focus { opacity: 1; }
@media (hover: none) { .shop-card-edit { opacity: 1; } }
.shop-card-edit svg { width: 16px; height: 16px; }
.shop-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.shop-card-cat { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--shop-blue); }
.shop-card-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.shop-card-desc { margin: 0; font-size: 13px; color: var(--shop-muted); line-height: 1.4; }
.shop-card-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.shop-card-price { font-size: 17px; }
.shop-card-stock { font-size: 12px; color: var(--shop-muted); }
.shop-card-add {
    margin-top: 10px; height: 38px; border: 0; border-radius: 10px; background: var(--crm-soft, #e6f4ff);
    color: var(--crm-soft-ink, #0958d9); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, color .15s;
}
.shop-card-add:hover { background: var(--shop-blue); color: #fff; }
.shop-card.in-cart .shop-card-add { background: var(--shop-blue); color: #fff; }
.shop-card-add:disabled { opacity: .6; cursor: default; }

.shop-empty, .shop-nothing {
    grid-column: 1 / -1; text-align: center; padding: 48px 16px; background: var(--shop-card);
    border: 1px dashed var(--shop-line); border-radius: var(--shop-radius); color: var(--shop-muted);
}
.shop-empty h3 { margin: 8px 0 4px; color: var(--shop-ink); }
.shop-empty p { margin: 0 0 16px; }
.shop-empty-icon { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; background: var(--crm-soft, #e6f4ff); color: var(--shop-blue); align-items: center; justify-content: center; }
.shop-empty-icon svg { width: 26px; height: 26px; }

/* cart */
.shop-cart {
    position: sticky; top: 16px; background: var(--shop-card); border: 1px solid var(--shop-line);
    border-radius: var(--shop-radius); padding: 18px; box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
}
.shop-cart.pulse { animation: shop-pulse .35s ease; }
@keyframes shop-pulse { 50% { transform: scale(1.015); } }
.shop-cart-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.shop-cart-head h3 { margin: 0; font-size: 17px; }
.shop-cart-count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--shop-blue);
    color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.shop-cart-clear { margin-left: auto; border: 0; background: none; color: var(--shop-muted); font-size: 13px; cursor: pointer; }
.shop-cart-clear:hover { color: #cf1322; }
.shop-cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; }
.shop-cart-line { padding: 10px 0; border-bottom: 1px solid var(--shop-line); }
.shop-cart-line-name { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.shop-cart-line-row { display: flex; align-items: center; justify-content: space-between; }
.shop-cart-empty { margin: 8px 0 12px; font-size: 13px; color: var(--shop-muted); }
.shop-cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; }
.shop-cart-total strong { font-size: 22px; }
.shop-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; margin-bottom: 12px; }
.shop-pay-opt { position: relative; cursor: pointer; }
.shop-pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.shop-pay-opt span {
    display: block; text-align: center; padding: 9px 6px; border: 1px solid var(--shop-line); border-radius: 10px;
    font-size: 13px; font-weight: 500; transition: all .15s;
}
.shop-pay-opt input:checked + span { border-color: var(--shop-blue); background: var(--crm-soft, #e6f4ff); color: var(--crm-soft-ink, #0958d9); }
.shop-pay-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--crm-blue-soft, rgba(22, 119, 255, .12)); }
.shop-cart-note { margin: 10px 0 0; font-size: 12px; color: var(--shop-muted); text-align: center; }
.shop-cart-fab { display: none; }

/* steppers */
.shop-stepper { display: inline-flex; align-items: center; border: 1px solid var(--shop-line); border-radius: 10px; overflow: hidden; background: var(--shop-card); }
.shop-stepper button {
    width: 36px; height: 36px; border: 0; background: none; font-size: 18px; color: var(--shop-ink); cursor: pointer;
}
.shop-stepper button:hover:not(:disabled) { background: var(--crm-hover, #f7faff); color: var(--shop-blue); }
.shop-stepper button:disabled { opacity: .35; cursor: default; }
.shop-stepper input, .shop-stepper span {
    width: 56px; height: 36px; border: 0; text-align: center; font-size: 15px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; -moz-appearance: textfield;
}
.shop-stepper input::-webkit-outer-spin-button, .shop-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-stepper--sm button { width: 30px; height: 30px; font-size: 16px; }
.shop-stepper--sm span { width: 32px; height: 30px; font-size: 14px; }

/* buttons */
.shop-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px;
    border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.shop-btn--primary { background: var(--shop-blue); color: #fff; }
.shop-btn--primary:hover:not(:disabled) { background: var(--crm-blue-hover, #0958d9); color: #fff; }
.shop-btn--primary:disabled { opacity: .45; cursor: default; }
.shop-btn--ghost { background: var(--shop-card); border-color: var(--shop-line); color: var(--shop-ink); }
.shop-btn--ghost:hover { border-color: var(--shop-blue); color: var(--shop-blue); }
.shop-btn--block { width: 100%; height: 46px; font-size: 15px; }
.shop-link-danger { border: 0; background: none; color: #cf1322; font-size: 14px; cursor: pointer; padding: 0; }
.shop-icon-btn { width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--shop-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.shop-icon-btn:hover { background: #fff1f0; color: #cf1322; }
.shop-icon-btn svg { width: 18px; height: 18px; }

/* panels & form */
.shop-panel { background: var(--shop-card); border: 1px solid var(--shop-line); border-radius: var(--shop-radius); padding: 20px; }
.shop-panel--narrow { max-width: 640px; }
.shop-panel-title { margin: 0 0 14px; font-size: 16px; }
.shop-panel-hint { margin: -8px 0 14px; font-size: 13px; color: var(--shop-muted); }
.shop-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.shop-form-main, .shop-form-side { display: flex; flex-direction: column; gap: 16px; }
.shop-form-side { position: sticky; top: 16px; }
.shop-form-actions { display: flex; flex-direction: column; gap: 8px; }
.shop-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; flex: 1; }
.shop-field label { font-size: 13px; font-weight: 600; color: var(--shop-muted); }
.shop-field input[type=text], .shop-field input[type=number], .shop-field select, .shop-field textarea, .shop-inline-form input, .shop-cat-rename input {
    width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--shop-line); border-radius: 10px;
    font-size: 15px; background: var(--shop-card); color: var(--shop-ink); font-family: inherit;
}
.shop-field textarea { resize: vertical; }
.shop-field-row { display: flex; gap: 14px; }
.shop-field-link { font-size: 12px; color: var(--shop-blue); text-decoration: none; }
.shop-input-suffix { position: relative; }
.shop-input-suffix input { padding-right: 32px !important; }
.shop-input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--shop-muted); }
.shop-error { font-size: 12px; color: #cf1322; }

.shop-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 500; }
.shop-switch input { position: absolute; opacity: 0; pointer-events: none; }
.shop-switch-track {
    flex: none; position: relative; width: 42px; height: 24px; border-radius: 12px; background: #d9d9d9; transition: background .2s;
}
.shop-switch-track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.shop-switch input:checked + .shop-switch-track { background: var(--shop-blue); }
.shop-switch input:checked + .shop-switch-track::after { transform: translateX(18px); }
.shop-switch small { display: block; font-weight: 400; font-size: 12px; color: var(--shop-muted); margin-top: 2px; }

.shop-stock { display: flex; flex-direction: column; }
.shop-stock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--shop-line); }
.shop-stock-row:last-child { border-bottom: 0; }

.shop-photo {
    position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
    border: 2px dashed var(--shop-line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--shop-well);
    transition: border-color .15s;
}
.shop-photo:hover { border-color: var(--shop-blue); }
.shop-photo img { width: 100%; height: 100%; object-fit: cover; }
.shop-photo-ph { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--shop-muted); text-align: center; padding: 12px; }
.shop-photo-ph svg { width: 36px; height: 36px; }
.shop-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shop-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--shop-muted); }
.shop-delete { margin-top: 4px; }

/* categories */
.shop-inline-form { display: flex; gap: 8px; margin-bottom: 16px; }
.shop-cat-list { list-style: none; margin: 0; padding: 0; }
.shop-cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--shop-line); }
.shop-cat-rename { display: flex; gap: 8px; flex: 1; }
.shop-cat-rename .shop-btn { height: 42px; }
.shop-cat-count { font-size: 13px; color: var(--shop-muted); white-space: nowrap; }
.shop-cat-empty { padding: 16px 0; color: var(--shop-muted); font-size: 14px; }

/* sales */
.shop-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 240px)); gap: 12px; }
.shop-stat { background: var(--shop-card); border: 1px solid var(--shop-line); border-radius: var(--shop-radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.shop-stat span { font-size: 13px; color: var(--shop-muted); }
.shop-stat strong { font-size: 22px; }
.shop-stat--accent { border-color: #ffd591; background: #fffbe6; }
.shop-orders { display: flex; flex-direction: column; gap: 10px; }
.shop-order { background: var(--shop-card); border: 1px solid var(--shop-line); border-radius: var(--shop-radius); padding: 14px 16px; }
.shop-order--pending { border-left: 4px solid #faad14; }
.shop-order--cancelled { opacity: .6; }
.shop-order-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop-order-top > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-order-top time { font-size: 13px; color: var(--shop-muted); }
.shop-order-sum { font-size: 17px; }
.shop-pill { padding: 2px 10px; border-radius: 999px; background: var(--shop-well); border: 1px solid var(--shop-line); font-size: 12px; }
.shop-pill--paid { background: #f6ffed; border-color: #b7eb8f; color: #389e0d; }
.shop-pill--pending { background: #fffbe6; border-color: #ffe58f; color: #ad6800; }
.shop-pill--cancelled { color: var(--shop-muted); }
.shop-pill--app { background: var(--crm-soft, #e6f4ff); border-color: var(--crm-soft-line, #91caff); color: var(--crm-soft-ink, #0958d9); }
.shop-order-items { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.shop-order-items li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.shop-order-items li span:last-child { color: var(--shop-muted); white-space: nowrap; }
.shop-order-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--shop-muted); }
.shop-order-actions { display: flex; gap: 8px; margin-top: 12px; }
.shop-pager { display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 14px; }

@media (max-width: 1100px) {
    .shop-layout.has-cart { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 900px) {
    .shop-layout.has-cart, .shop-form { grid-template-columns: 1fr; }
    .shop-form-side { position: static; }
    .shop-cart { position: static; }
    .shop-layout.has-cart { padding-bottom: 72px; }
    .shop-cart-fab:not([hidden]) {
        display: block; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; height: 52px;
        border: 0; border-radius: 14px; background: var(--shop-blue); color: #fff; font-size: 16px; font-weight: 600;
        box-shadow: 0 8px 24px rgba(22, 119, 255, .35);
    }
}
@media (max-width: 560px) {
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .shop-card-body { padding: 10px; }
    .shop-card-desc { display: none; }
    .shop-field-row { flex-direction: column; gap: 0; }
    .shop-add-btn { margin-left: 0; }
    .shop-today { margin-left: 0; align-items: flex-start; }
}
