.cm-page {
    width: min(1200px, calc(100% - 40px));
    margin: 28px auto 48px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
}

.cm-title {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.cm-subtitle,
.cm-sku,
.text-muted {
    color: #64748b;
}

.cm-card {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.cm-card-body {
    padding: 20px;
}

.cm-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 6px 0;
}

.cm-card-title a {
    color: inherit;
    text-decoration: none;
}

.cm-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f47d31;
    margin-bottom: 8px;
}

.cm-price,
.cm-price-lg {
    font-weight: 700;
    color: #027afd;
}

.cm-product-card .cm-offer {
    text-align: center;
}

.cm-product-card .cm-offer .cm-price,
.cm-product-card .cm-offer .cm-sku {
    text-align: center;
}

.cm-price-lg {
    font-size: 1.5rem;
}

.cm-vendor-name {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.cm-product-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef2fa;
}

.cm-product-thumb img,
.cm-product-detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-product-detail-img {
    border-radius: 16px;
    max-height: 460px;
}

.cm-filters {
    margin: 8px 0 36px;
}

.cm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 8px;
}

.cm-detail {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

.cm-filters-row,
.d-flex {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cm-filters-row input,
.cm-filters-row select,
.cm-line input,
.cm-detail input {
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    min-width: 0;
}

.cm-filters-row input { flex: 1.4; }
.cm-filters-row select { flex: 1; }

.cm-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.cm-card-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.cm-page .btn-sm { padding: 6px 10px; font-size: 13px; }
.cm-page .btn-primary { background: #027afd; color: #fff; }
.cm-page .btn-outline-primary,
.cm-page .btn-outline-secondary { background: #fff; color: #027afd; border-color: #027afd; }
.cm-page .btn-outline-secondary.is-active { background: #027afd; color: #fff; }
.cm-page .badge { background: #027afd; color: #fff; border-radius: 999px; padding: 2px 7px; font-size: 11px; }

.cm-line {
    display: grid;
    grid-template-columns: 72px 1fr 90px;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}

.cm-line img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
}

.ks-rail {
    position: fixed;
    top: 50%;
    right: 0;
    left: auto;
    z-index: 35;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.ks-rail a {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    overflow: hidden;
    padding: 0 8px;
    border-radius: 12px 0 0 12px;
    background: #027afd;
    color: #fff;
    text-decoration: none;
    box-shadow: -4px 6px 14px rgba(2, 122, 253, 0.28);
    transition: width 0.2s ease, gap 0.2s ease;
}

.ks-rail a svg { width: 20px; height: 20px; flex: 0 0 20px; }
.ks-rail a span {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}
.ks-rail a:hover,
.ks-rail a:focus-visible {
    width: 112px;
    gap: 6px;
}
.ks-rail a:hover span,
.ks-rail a:focus-visible span { max-width: 72px; opacity: 1; }
.ks-rail a.ks-rail-workers { background: #0f766e; }
.ks-rail a.ks-rail-delivery { background: #c45e12; }

.ks-install {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 108px;
    z-index: 40;
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    max-width: 520px;
}

.ks-install img { width: 42px; height: 42px; border-radius: 10px; }
.ks-install p { margin: 2px 0 0; color: #64748b; font-size: 13px; }
.ks-install[hidden] { display: none !important; }
.ks-install button {
    border: 0;
    background: #1d6fe8;
    color: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}
#ksInstallHide {
    background: #f2f2f5;
    color: #1d1d1f;
    width: auto;
    min-height: 44px;
    height: auto;
    padding: 10px 14px;
    flex: 1 1 0;
}

.ks-manage {
    box-sizing: border-box;
    margin: 28px auto 0;
    border-radius: 28px;
    padding: 28px;
    background: #fff;
    box-shadow: inset 0 1px 0 #fff, 0 16px 40px rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 18px;
    width: min(1120px, calc(100% - 24px));
    max-width: calc(100% - 24px);
}

.cm-hero { position: relative; border-radius: 24px; overflow: hidden; min-height: 320px; margin-bottom: 28px; background: #0f172a; }
.cm-hero-slide { display: none; min-height: 320px; background-size: cover; background-position: center; }
.cm-hero-slide.is-on { display: flex; align-items: flex-end; }
.cm-hero-slide div { width: 100%; padding: 28px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62)); }
.cm-hero-slide h2 { margin: 0 0 4px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; }
.cm-hero-slide p { margin: 0; max-width: 520px; }
.cm-hero-nav { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; }
.cm-hero-nav button { width: 36px; height: 36px; border: 0; border-radius: 999px; background: #fff; cursor: pointer; }

@media (max-width: 991.98px) {
    .cm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cm-detail, .ks-manage { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-filters-row { display: grid; grid-template-columns: 1fr; }
    .ks-rail a { width: 34px; height: 34px; padding: 0; }
    .ks-rail a:hover,
    .ks-rail a:focus-visible { width: 36px; gap: 0; }
    .ks-rail a:hover span,
    .ks-rail a:focus-visible span { max-width: 0; opacity: 0; }
}
