/* Products tab hub: FAB + bottom sheet + compact cards */

/*
 * base.css sets body { display: flex } which puts every direct child in a ROW — catastrophic on mobile.
 * Scope a normal block layout for this page only (same root cause as needing horizontal pan).
 */
html.products-hub-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.products-hub-page {
    display: block !important;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.d-none {
    display: none !important;
}

.products-hub-main {
    width: 100%;
    max-width: 720px;
    min-width: 0;
    margin: 0 auto;
    padding: 12px min(16px, 4vw) calc(var(--kimia-mobile-tab-offset, 76px) + 52px);
    box-sizing: border-box;
}

.products-hub-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    width: 100%;
    min-width: 0;
}

.products-hub-header__copy {
    flex: 1 1 220px;
    min-width: 0;
}

.products-hub-header__menu {
    flex: 0 0 auto;
    position: relative;
    z-index: 40;
}

.products-hub-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
}

.products-hub-sub {
    margin: 0 0 18px;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.products-hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    width: 100%;
    min-width: 0;
}

.products-hub-sync-status {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    flex: 1 1 100%;
}

.products-hub-sync-status.is-stale {
    color: #b45309;
}

.products-hub-sync-status.is-syncing {
    color: #0369a1;
}

.products-hub-catalog-sync {
    flex: 1 1 100%;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #bae6fd;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    box-shadow: 0 1px 0 rgba(14, 116, 144, 0.06);
}

.products-hub-catalog-sync__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.products-hub-catalog-sync__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: right;
    flex: 1 1 auto;
    min-width: 0;
}

.products-hub-catalog-sync__title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0c4a6e;
}

.products-hub-catalog-sync__toggle-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    color: #0369a1;
}

.products-hub-catalog-sync__toggle-label {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.products-hub-catalog-sync__chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}

.products-hub-catalog-sync__toggle[aria-expanded="true"] .products-hub-catalog-sync__chevron {
    transform: rotate(180deg);
}

.products-hub-catalog-sync__pct {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0369a1;
    font-variant-numeric: tabular-nums;
}

.products-hub-catalog-sync__track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    direction: rtl;
}

.products-hub-catalog-sync__fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(270deg, #38bdf8, #0284c7);
    transition: width 0.45s ease;
}

.products-hub-catalog-sync.is-stalled .products-hub-catalog-sync__fill {
    background: linear-gradient(90deg, #fbbf24, #d97706);
}

.products-hub-catalog-sync__detail {
    margin: 8px 0 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
}

.products-hub-catalog-sync__retry {
    margin-top: 8px;
    border: 1px solid #0284c7;
    background: #fff;
    color: #0369a1;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.products-hub-catalog-sync__retry:hover {
    background: #e0f2fe;
}

.products-hub-catalog-sync__items {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.products-hub-catalog-sync__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    align-items: start;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.products-hub-catalog-sync__item-name {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.45;
}

.products-hub-catalog-sync__item-meta {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    color: #64748b;
}

.products-hub-catalog-sync__item-error {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    color: #b45309;
    line-height: 1.5;
}

.products-hub-catalog-sync__item-note {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    color: #0369a1;
    line-height: 1.5;
}

.products-hub-catalog-sync__badge {
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
}

.products-hub-catalog-sync__badge.is-pending {
    background: #e0f2fe;
    color: #0369a1;
}

.products-hub-catalog-sync__badge.is-synced {
    background: #dcfce7;
    color: #15803d;
}

.products-hub-catalog-sync__badge.is-failed {
    background: #fee2e2;
    color: #b91c1c;
}

.products-hub-catalog-sync__badge.is-skipped {
    background: #f1f5f9;
    color: #475569;
}

.products-hub-catalog-sync__badge.is-needs_review {
    background: #fef3c7;
    color: #b45309;
}

.products-hub-catalog-sync__suggestions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.products-hub-catalog-sync__suggestion {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.products-hub-catalog-sync__suggestion input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.products-hub-catalog-sync__suggestion-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.products-hub-catalog-sync__suggestion-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
}

.products-hub-catalog-sync__suggestion-score {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

.products-hub-catalog-sync__apply-link {
    grid-column: 1 / -1;
    border: 1px solid #0284c7;
    background: #0284c7;
    color: #fff;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.products-hub-catalog-sync__apply-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.products-hub-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.products-hub-search {
    flex: 1 1 260px;
    min-width: 180px;
    position: relative;
    display: flex;
    align-items: center;
}

.products-hub-search__icon {
    position: absolute;
    right: 12px;
    pointer-events: none;
    opacity: 0.55;
}

.products-hub-search input {
    width: 100%;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0 40px 0 12px;
    outline: none;
}

.products-hub-search input::placeholder {
    color: #94a3b8;
}

.products-hub-search input:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.24);
}

.products-hub-icon-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #334155;
    flex-shrink: 0;
}

.products-hub-icon-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.products-hub-icon-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.products-hub-toolbar-icon {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.products-hub-filter.is-active {
    border-color: #86efac;
    background: #ecfdf5;
    color: #047857;
}

.products-hub-filter-sheet__head {
    padding: 4px 4px 12px;
    text-align: right;
}

.products-hub-filter-sheet__title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.products-hub-filter-sheet__sub {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #64748b;
}

.products-hub-filter-sheet__body {
    padding-bottom: 8px;
    max-height: min(58vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.products-hub-filter-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

@media (min-width: 380px) {
    .products-hub-filter-tile-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 520px) {
    .products-hub-filter-tile-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.products-hub-filter-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 68px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    padding: 6px 4px 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.products-hub-filter-tile:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.products-hub-filter-tile.is-selected {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
}

.products-hub-filter-tile__check {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    z-index: 1;
}

.products-hub-filter-tile.is-selected .products-hub-filter-tile__check {
    border-color: #10b981;
    background: #10b981;
}

.products-hub-filter-tile.is-selected .products-hub-filter-tile__check::after {
    content: '';
    position: absolute;
    inset: 2px 4px 4px 2px;
    border: solid #fff;
    border-width: 0 0 1.5px 1.5px;
    transform: rotate(-45deg);
}

.products-hub-filter-tile__icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    flex-shrink: 0;
}

.products-hub-filter-tile__icon-wrap--default {
    background: #f8fafc;
}

.products-hub-filter-tile__icon-wrap--woo { background: #f3e8ff; }
.products-hub-filter-tile__icon-wrap--amadast { background: #eff6ff; }
.products-hub-filter-tile__icon-wrap--instagram {
    background: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 55%, #fff7ed 100%);
}
.products-hub-filter-tile__icon-wrap--mixin { background: #f0fdf4; }
.products-hub-filter-tile__icon-wrap--telegram { background: #eff6ff; }
.products-hub-filter-tile__icon-wrap--eitaa { background: #fff7ed; }
.products-hub-filter-tile__icon-wrap--snappshop { background: #fefce8; }
.products-hub-filter-tile__icon-wrap--digikala { background: #fef2f2; }
.products-hub-filter-tile__icon-wrap--basalam { background: #fff7ed; }
.products-hub-filter-tile__icon-wrap--excel { background: #ecfdf5; }
.products-hub-filter-tile__icon-wrap--manual,
.products-hub-filter-tile__icon-wrap--hub_catalog { background: #f1f5f9; }

.products-hub-filter-tile__icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.products-hub-filter-tile__icon-img img,
.products-hub-filter-tile__icon-img svg,
.products-hub-filter-tile__icon-img.kimia-platform-icon--size-md,
.products-hub-filter-tile__icon-img.kimia-platform-icon--size-sm {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.products-hub-filter-tile__all-glyph {
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
    color: #64748b;
}

.products-hub-filter-tile__label {
    width: 100%;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    color: #334155;
    padding: 0 1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.products-hub-filter-sheet__footer {
    padding-top: 12px;
}

.products-hub-filter-sheet__actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.products-hub-filter-sheet__actions .products-hub-ghost-btn,
.products-hub-filter-sheet__actions .products-hub-primary-btn {
    flex: 1;
    min-height: 44px;
}

.products-hub-icon-btn[data-filter-count]::after {
    content: attr(data-filter-count);
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #10b981;
    color: #fff;
    font-family: var(--kimia-font-family-fanum);
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.products-hub-icon-btn {
    position: relative;
}

.products-hub-grid {
    width: 100%;
    min-width: 0;
}

.products-hub-card--skeleton {
    pointer-events: none;
}

.products-hub-skeleton-block {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
    background-size: 200% 100%;
    animation: products-hub-skeleton-shimmer 1.2s ease-in-out infinite;
}

.products-hub-skeleton-line {
    height: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
    background-size: 200% 100%;
    animation: products-hub-skeleton-shimmer 1.2s ease-in-out infinite;
}

.products-hub-skeleton-line--title {
    width: 78%;
    height: 14px;
}

.products-hub-skeleton-line--price {
    width: 42%;
}

.products-hub-skeleton-line--strip {
    width: 92%;
    margin-bottom: 0;
}

@keyframes products-hub-skeleton-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.products-hub-sync-status.is-search {
    color: #0369a1;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.products-hub-fab {
    position: fixed;
    left: 16px;
    bottom: calc(var(--kimia-mobile-tab-offset, 76px) + 8px);
    z-index: 52;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(145deg, #0ea56a, #059669);
    color: #fff;
    box-shadow:
        0 12px 28px rgba(5, 150, 105, 0.35),
        0 2px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    display: grid;
    place-items: center;
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    transition:
        transform 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s ease,
        filter 0.15s ease;
}

.products-hub-fab:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.products-hub-fab svg {
    width: 26px;
    height: 26px;
}

.products-hub-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.products-hub-sheet-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.products-hub-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    width: 100%;
    max-width: 100vw;
    background: #fff;
    border-radius: 22px 22px 0 0;
    max-height: min(88vh, 620px);
    max-height: min(88dvh, 620px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
}

.products-hub-sheet.is-open {
    transform: translateY(0);
}

.products-hub-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: #e2e8f0;
    margin: 10px auto 6px;
}

.products-hub-sheet-head {
    flex-shrink: 0;
    padding: 4px 18px 12px;
    border-bottom: 1px solid #eef2f7;
    position: relative;
}

.products-hub-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #059669;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
}

.products-hub-back-btn.d-none {
    display: none !important;
}

.products-hub-sheet-head h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.products-hub-sheet-head p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.55;
}

.products-hub-step-pick {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.products-hub-sheet-dynamic {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px min(14px, 4vw) 10px;
    -webkit-overflow-scrolling: touch;
}

.products-hub-sheet-dynamic.d-none {
    display: none !important;
}

.products-hub-step-pick.d-none {
    display: none !important;
}

.products-hub-source-grid {
    padding: 14px min(14px, 4vw) 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
}

.products-hub-source-group-title {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    font-weight: 900;
    color: #0f172a;
    padding-top: 4px;
}

.products-hub-source-card {
    border: 1.5px solid #e8edf4;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    cursor: pointer;
    background: #fff;
    text-align: right;
    direction: rtl;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.products-hub-source-card img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    align-self: flex-start;
}

.products-hub-source-card strong {
    font-size: 0.85rem;
    font-weight: 900;
    color: #0f172a;
}

.products-hub-source-card span.sub {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
}

.products-hub-source-status {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.68rem;
    font-weight: 800;
}

.products-hub-source-status.is-ok {
    background: #ecfdf5;
    color: #047857;
}

.products-hub-source-card.is-selected {
    border-color: #059669;
    background: #f0fdf6;
}

.products-hub-source-card.is-disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.products-hub-sheet-footer {
    flex: 0 0 auto;
    flex-shrink: 0;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eef2f7;
    background: #fafbfc;
    position: relative;
    z-index: 2;
}

.products-hub-primary-btn {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(145deg, #0ea56a, #059669);
    color: #fff;
    font-weight: 900;
    font-size: 0.92rem;
    cursor: pointer;
}

.products-hub-primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.products-hub-progress {
    margin-top: 10px;
}

.products-hub-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.products-hub-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #059669);
    width: 0%;
    transition: width 0.35s ease;
}

.products-hub-progress-label {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #475569;
    text-align: center;
}

/* Product card — dashboard RTL layout */
.products-hub-card {
    --phc-accent: #7c3aed;
    --phc-surface: #f7f8fb;
    position: relative;
    display: grid;
    grid-template-columns: clamp(104px, 30vw, 132px) minmax(0, 1fr);
    align-items: stretch;
    gap: 14px 16px;
    padding: 46px 16px 18px;
    border: 1px solid #e8ebf2;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff 0%, var(--phc-surface) 100%);
    margin-bottom: 14px;
    direction: rtl;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    box-shadow:
        10px 10px 22px rgba(148, 163, 184, 0.16),
        -8px -8px 18px rgba(255, 255, 255, 0.92),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.products-hub-card.is-selected {
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow:
        0 0 0 1px rgba(124, 58, 237, 0.18),
        10px 10px 22px rgba(148, 163, 184, 0.16),
        -8px -8px 18px rgba(255, 255, 255, 0.92);
}

.products-hub-card__toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
}

.products-hub-card__edit-btn,
.products-hub-card__history-btn {
    position: static;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(124, 58, 237, 0.55);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: #7c3aed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.products-hub-card__edit-btn img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(32%) sepia(72%) saturate(2878%) hue-rotate(248deg) brightness(92%) contrast(95%);
}

.products-hub-card__edit-btn:hover {
    border-color: #7c3aed;
    background: #faf5ff;
    transform: translateY(-1px);
}

.products-hub-card__edit-btn:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

.products-hub-card__history-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.products-hub-card__history-btn img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    opacity: 0.82;
}

.products-hub-card__history-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.products-hub-card__history-btn:focus-visible {
    outline: 2px solid #64748b;
    outline-offset: 2px;
}

.products-hub-card__pick {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    cursor: pointer;
}

.products-hub-card__pick input {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.products-hub-card__pick input:checked {
    border-color: #7c3aed;
    background: #f5f3ff;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.25);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11.1 12.5 5' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

.products-hub-card__media {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    align-self: stretch;
}

.products-hub-card__media-main {
    flex: 1 1 auto;
    min-height: 108px;
    border-radius: 16px;
    overflow: hidden;
    background: #eef2f7;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.products-hub-card__media-main img {
    width: 100%;
    height: 100%;
    min-height: 108px;
    object-fit: cover;
    display: block;
}

.products-hub-card__media-thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.products-hub-card__media-thumb {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f7;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.products-hub-card__media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.products-hub-card__content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-inline-start: 2px;
}

.products-hub-card__title {
    margin: 0;
    font-size: clamp(1rem, 3.8vw, 1.18rem);
    font-weight: var(--kimia-weight-title, 800);
    line-height: 1.45;
    color: #0f172a;
    text-align: right;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-hub-card__field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
}

.products-hub-card__field--platforms {
    align-items: center;
}

.products-hub-card__field--platforms .products-hub-card__label {
    line-height: 1.35;
    align-self: center;
}

.products-hub-card__field--platforms .products-hub-card__platform-list,
.products-hub-card__field--platforms .products-hub-card__platform-empty {
    align-self: center;
}

.products-hub-card__label {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.products-hub-card__source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
    min-width: 0;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 600;
    overflow: hidden;
}

.products-hub-card__source-badge-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-inline-end: 8px;
    margin-inline-end: 8px;
}

.products-hub-card__source-badge-icon::after {
    content: '';
    position: absolute;
    inset-block: 1px;
    inset-inline-end: 0;
    width: 1px;
    background: currentColor;
    opacity: 0.35;
}

.products-hub-card__source-badge-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.products-hub-card__source-badge--woo .products-hub-card__source-badge-icon img,
.products-hub-card__source-badge--amadast .products-hub-card__source-badge-icon img {
    width: 24px;
    height: 24px;
}

.products-hub-card__source-badge-text {
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products-hub-card__source-badge--woo {
    background: #f3e8ff;
    border-color: #d8b4fe;
    color: #6b21a8;
}

.products-hub-card__source-badge--amadast {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.products-hub-card__source-badge--instagram {
    background: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 55%, #fff7ed 100%);
    border-color: #f9a8d4;
    color: #9d174d;
}

.products-hub-card__source-badge--mixin {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.products-hub-card__source-badge--telegram {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.products-hub-card__source-badge--eitaa {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.products-hub-card__source-badge--snappshop {
    background: #fefce8;
    border-color: #fde047;
    color: #a16207;
}

.products-hub-card__source-badge--digikala {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.products-hub-card__source-badge--basalam {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.products-hub-card__source-badge--excel {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.products-hub-card__source-badge--manual,
.products-hub-card__source-badge--default {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.products-hub-card__price-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-block: 1px solid #e8edf4;
    min-width: 0;
}

.products-hub-card__price-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.14);
}

.products-hub-card__price-icon img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(58%) sepia(52%) saturate(748%) hue-rotate(213deg) brightness(99%) contrast(93%);
}

.products-hub-card__price {
    font-size: clamp(0.95rem, 3.6vw, 1.12rem);
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-hub-card__platform-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.products-hub-card__platform-list .products-hub-card__source-badge,
.products-hub-card__platform-list .products-hub-card__platform-badge {
    flex-shrink: 0;
}

.products-hub-card__platform-empty {
    font-size: 0.8rem;
    font-weight: 500;
    color: #94a3b8;
}

.products-hub-card__platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
    min-width: 0;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 500;
}

.products-hub-card__platform-badge-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-inline-end: 8px;
    margin-inline-end: 8px;
}

.products-hub-card__platform-badge-icon::after {
    content: '';
    position: absolute;
    inset-block: 1px;
    inset-inline-end: 0;
    width: 1px;
    background: currentColor;
    opacity: 0.35;
}

.products-hub-card__platform-badge-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.products-hub-card__platform-badge-icon.kimia-platform-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.products-hub-card__platform-badge-text {
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products-hub-card__platform-badge--eitaa {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.products-hub-card__platform-badge--bale {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}

.products-hub-card__platform-badge--rubika {
    background: #fdf2f8;
    border-color: #f9a8d4;
    color: #be185d;
}

.products-hub-card__platform-badge--soroushplus {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Legacy meta pills (used outside card grid) */
.products-hub-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.products-hub-card__row--meta {
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 6px;
}

.products-hub-card__row--meta .products-hub-card__price {
    margin-inline-start: auto;
}

.products-hub-card__desc {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-hub-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.55);
    border: 1px solid rgba(100, 116, 139, 0.42);
    color: #334155;
    max-width: min(100%, 160px);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products-hub-inventory-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.products-hub-inventory-pill--ok {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-variant-numeric: tabular-nums;
}

.products-hub-inventory-pill--out {
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.products-hub-field--inline {
    margin-bottom: 0;
}

.products-hub-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.products-hub-check input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #059669;
}

.products-hub-source-pill img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: contrast(1.08) saturate(1.12);
}

.products-hub-messenger-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.products-hub-messenger-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    opacity: 1;
    flex-shrink: 0;
}

.products-hub-messenger-ico.is-connected {
    opacity: 1;
    border-color: rgba(5, 150, 105, 0.4);
    background: #f0fdf4;
}

.products-hub-messenger-ico.is-disconnected {
    border-color: #dbe4ee;
    background: #f8fafc;
}

.products-hub-messenger-ico img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.products-hub-bulk-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--kimia-mobile-tab-offset, 76px) + 12px);
    z-index: 35;
    display: flex;
    justify-content: center;
    transform: translateY(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease;
}

.products-hub-bulk-bar button {
    pointer-events: none;
    border: none;
    border-radius: 14px;
    padding: 12px 20px;
    width: 100%;
    max-width: 320px;
    font-weight: 900;
    font-size: 0.88rem;
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.28);
    cursor: pointer;
    transform: translateY(16px);
    opacity: 0;
    transition:
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.05s,
        opacity 0.26s ease 0.05s,
        box-shadow 0.2s ease;
}

body.products-hub-bulk-visible .products-hub-fab {
    transform: translateY(88px) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

body.products-hub-bulk-visible .products-hub-bulk-bar {
    transform: translateY(0);
    opacity: 1;
    pointer-events: none;
}

body.products-hub-bulk-visible .products-hub-bulk-bar button {
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
}

.products-hub-empty {
    text-align: center;
    padding: 36px 16px;
    color: #64748b;
    font-size: 0.9rem;
}

/* Hub dynamic forms (manual / excel / connection) */
.products-hub-dynamic-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.products-hub-mini-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
}

.products-hub-mini-muted {
    font-size: 0.78rem;
    color: #94a3b8;
}

.products-hub-mini-warn {
    color: #dc2626;
    font-size: 0.75rem;
}

.products-hub-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.products-hub-field label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
}

.products-hub-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.products-hub-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.88rem;
    background: #fff;
}

.products-hub-textarea {
    resize: vertical;
    min-height: 56px;
}

.products-hub-file {
    font-size: 0.82rem;
}

.products-hub-secondary-btn {
    border: 1px solid #059669;
    background: #fff;
    color: #059669;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
}

.products-hub-ghost-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
}

.products-hub-primary-btn--narrow {
    width: auto;
    min-width: 140px;
    padding-left: 18px;
    padding-right: 18px;
}

.products-hub-dynamic-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.products-hub-mini-table-wrap {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #eef2f7;
    border-radius: 12px;
}

.products-hub-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.products-hub-mini-table th,
.products-hub-mini-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
}

.products-hub-mini-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 8px;
    margin-left: 4px;
}

.products-hub-mini-btn {
    border: none;
    background: transparent;
    color: #dc2626;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.78rem;
}

.products-hub-link {
    color: #059669;
    font-weight: 800;
    font-size: 0.82rem;
    text-decoration: none;
}

.products-hub-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.products-hub-mini-msg {
    font-size: 0.82rem;
    color: #475569;
}

.products-hub-excel-preview {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 10px;
    max-height: 160px;
    overflow-y: auto;
}

.products-hub-excel-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 0.82rem;
}

.products-hub-connect-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.products-hub-connect-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
}

.products-hub-connect-help {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #64748b;
}

.products-hub-loc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 8px;
}

.products-hub-loc-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    text-align: right;
    border: 1.5px solid #e8edf4;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    cursor: pointer;
    font-size: 0.78rem;
}

.products-hub-loc-item.is-active {
    border-color: #059669;
    background: #f0fdf6;
}

.products-hub-loc-item small {
    color: #64748b;
    font-size: 0.72rem;
}

@media (max-width: 480px) {
    .products-hub-card {
        grid-template-columns: clamp(92px, 28vw, 112px) minmax(0, 1fr);
        gap: 10px 12px;
        padding: 44px 12px 14px;
    }

    .products-hub-card__media-main {
        min-height: 96px;
    }

    .products-hub-card__media-main img {
        min-height: 96px;
    }

    .products-hub-fab {
        left: max(12px, env(safe-area-inset-left, 0px));
        bottom: calc(var(--kimia-mobile-tab-offset, 76px) + 4px);
        width: 52px;
        height: 52px;
    }

    .products-hub-bulk-bar {
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--kimia-mobile-tab-offset, 76px) + 8px);
    }

    .products-hub-bulk-bar button {
        max-width: 100%;
        font-size: 0.82rem;
        padding: 10px 16px;
        border-radius: 12px;
    }

    body.products-hub-bulk-visible .products-hub-fab {
        transform: translateY(96px) scale(0.9);
        opacity: 0;
        pointer-events: none;
    }
}

@media (min-width: 768px) {
    .products-hub-fab {
        left: calc(50% - 360px + 16px);
    }
}

/* Bulk transfer / payment sheets above FAB sheet */
.products-transfer-stack.products-hub-sheet-overlay {
    z-index: 120;
}

.products-transfer-stack.products-hub-sheet {
    z-index: 130;
}

.products-transfer-sheet-head {
    text-align: center;
    padding-bottom: 14px;
}

.products-transfer-sheet-head .products-transfer-sheet-title,
.products-transfer-sheet-head .products-transfer-sheet-sub {
    text-align: center;
}

.products-transfer-sheet-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.products-transfer-sheet-sub {
    margin: 0 auto;
    max-width: 28rem;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.6;
}

.products-transfer-sheet-body {
    padding-top: 4px;
}

.products-transfer-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #e8edf4;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.products-transfer-sheet-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
}

.products-transfer-footer-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
}

.products-transfer-sheet-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.5;
    text-align: center;
}

.products-transfer-sheet-note svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.products-transfer-btn-confirm {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.products-transfer-stack .products-transfer-footer-actions .my-products-modal-btn {
    flex: 1;
    min-height: 48px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 800;
}

.products-transfer-stack .products-transfer-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.products-transfer-processing-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 120px;
    padding: 8px 0 24px;
}

.products-transfer-processing-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    animation: products-transfer-processing-spin 0.75s linear infinite;
}

@keyframes products-transfer-processing-spin {
    to {
        transform: rotate(360deg);
    }
}

.products-transfer-processing-sheet .products-hub-sheet-footer {
    display: none;
}

.products-transfer-stack .products-transfer-btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.products-catalog-edit-sheet {
    max-height: min(92vh, 760px);
    max-height: min(92dvh, 760px);
    border-radius: 28px 28px 0 0;
}

.products-catalog-edit-head {
    text-align: center;
    padding: 8px 20px 14px;
}

.products-catalog-edit-cancel {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.products-catalog-edit-cancel:hover {
    background: #fecaca;
    color: #991b1b;
}

.products-catalog-edit-body {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.products-catalog-edit-textarea {
    min-height: 116px;
}

.products-catalog-edit-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    width: 100%;
}

.products-catalog-edit-image-card,
.products-catalog-edit-image-add {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
}

.products-catalog-edit-image-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #f8fafc;
}

.products-catalog-edit-image-card.is-new {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.products-catalog-edit-image-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #475569;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.products-catalog-edit-image-primary {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.96);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.products-catalog-edit-image-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #2563eb;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    padding: 8px;
}

.products-catalog-edit-image-add span:last-child {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
}

.products-catalog-edit-image-add-plus {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1.5px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

.products-catalog-edit-image-add--loading {
    cursor: default;
    pointer-events: none;
}

.products-catalog-edit-image-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid #e2e8f0;
    border-top-color: #2563eb;
    animation: products-transfer-processing-spin 0.75s linear infinite;
}

.products-catalog-edit-file-input {
    display: none;
}

.products-hub-input-hint {
    margin: 6px 2px 0;
    min-height: 1.2em;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #0369a1;
    font-weight: 600;
}

.products-hub-input-hint.is-empty {
    display: none;
}

.products-hub-source-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 12px;
    color: #64748b;
    font-size: 0.85rem;
}

.products-catalog-edit-switch-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2px 0;
}

.products-catalog-edit-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.products-catalog-edit-switch input {
    display: none;
}

.products-catalog-edit-switch-ui {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #dbe4ee;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.products-catalog-edit-switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease;
}

.products-catalog-edit-switch input:checked ~ .products-catalog-edit-switch-ui {
    background: #2563eb;
}

.products-catalog-edit-switch input:checked ~ .products-catalog-edit-switch-ui::after {
    transform: translateX(20px);
}

.products-transfer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    direction: rtl;
}

.products-transfer-row + .products-transfer-row {
    border-top: 1px solid #eef2f7;
}

.products-transfer-row.is-disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.products-transfer-row-body {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.products-transfer-platform-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 12px;
}

.products-transfer-row-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    text-align: right;
}

.products-transfer-row-label {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.35;
}

.products-transfer-row-muted {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.products-transfer-row-hint {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.45;
}

.products-transfer-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
}

.products-transfer-check-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.products-transfer-check-input:disabled {
    cursor: not-allowed;
}

.products-transfer-check-circle {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    pointer-events: none;
}

.products-transfer-check-input:checked + .products-transfer-check-circle {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.products-transfer-check-input:checked + .products-transfer-check-circle::after {
    content: "";
    width: 6px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translateY(-1px);
}

.products-transfer-check-input:focus-visible + .products-transfer-check-circle {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.products-transfer-check-input:disabled + .products-transfer-check-circle {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.products-transfer-row--disconnect {
    flex-wrap: wrap;
    cursor: default;
}

.products-transfer-connect-btn {
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 8px 12px;
}

.products-transfer-sheet-footer.is-subview-hidden {
    display: none;
}

.products-transfer-empty,
.products-transfer-loading {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.products-transfer-loading {
    text-align: center;
    padding: 18px 8px;
}



/* Channel bottom sheets (products hub) */
.kimia-channel-sheet-root {
    position: fixed;
    inset: 0;
    z-index: 125;
    pointer-events: none;
}

.kimia-channel-sheet-root:not(.d-none) {
    pointer-events: auto;
}

.kimia-channel-sheet {
    max-height: min(90vh, 680px);
    max-height: min(90dvh, 680px);
}

.kimia-channel-sheet-inner {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 18px 22px;
    -webkit-overflow-scrolling: touch;
}

.kimia-channel-sheet-title {
    margin: 0 0 8px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.kimia-channel-sheet-desc {
    margin: 0 0 16px;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.55;
}

.kimia-channel-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 700;
}

.kimia-channel-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    font-family: inherit;
    text-align: left;
    font-size: 0.92rem;
}

.kimia-channel-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
}

.kimia-channel-price-wrap {
    margin-bottom: 12px;
}

.kimia-channel-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.kimia-channel-actions .kimia-channel-btn {
    flex: 1;
}

.kimia-channel-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.channel-preview-card {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.channel-preview-card__head {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #dbe5f1;
}

.channel-preview-card__title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.channel-preview-card__subtitle {
    margin-top: 2px;
    font-size: 11px;
    color: #64748b;
}
