/* ── BG scheme ──────────────────────────────────────────────────────────── */
.nexab-pf--light  { background: var(--nx-bg-subtle, #f7f8fb); }
.nexab-pf--dark   {
    background: var(--nx-bg-dark, #0f172a);
    --nx-heading: #f1f5f9; --nx-text: #cbd5e1;
    --nx-muted: #94a3b8;   --nx-border: rgba(255,255,255,.1);
    --nx-bg: #1e293b;      --nx-surface: #1e293b;
}
.nexab-pf--dark .nexab-pf__title,
.nexab-pf--dark .nexab-pf__subtitle  { color: var(--nx-heading, #f1f5f9); }
.nexab-pf--accent {
    background: var(--nx-accent, #0d9488);
    --nx-heading: #fff; --nx-text: rgba(255,255,255,.9);
    --nx-muted: rgba(255,255,255,.7); --nx-border: rgba(255,255,255,.2);
    --nx-bg: rgba(255,255,255,.1); --nx-surface: rgba(255,255,255,.08);
}

/* ── Section header ─────────────────────────────────────────────────────── */
.nexab-pf__header { text-align: center; margin-bottom: 2.25rem; }
.nexab-pf__title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--nx-heading, #10243d);
    margin: 0 0 .625rem;
    line-height: 1.2;
}
.nexab-pf__subtitle {
    color: var(--nx-muted, #6b7280);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* ── Grid mode ──────────────────────────────────────────────────────────── */
.nexab-pf__grid { display: grid; gap: 1.25rem; }
.nexab-pf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.nexab-pf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.nexab-pf-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Slider mode ────────────────────────────────────────────────────────── */
.nexab-pf__slider-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.nexab-pf__slider-track {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.nexab-pf__slider-track::-webkit-scrollbar { display: none; }
.nexab-pf__slider-track .nexab-cs-card {
    flex: 0 0 calc(
        (100% - (var(--nexab-pf-cols, 4) - 1) * 1.25rem)
        / var(--nexab-pf-cols, 4)
    );
    scroll-snap-align: start;
    min-width: 180px;
}

/* Nav buttons */
.nexab-pf__nav {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid var(--nx-border, #e5e7eb);
    background: var(--nx-bg, #fff);
    color: var(--nx-heading, #10243d);
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    font-family: inherit;
}
.nexab-pf__nav:hover {
    background: var(--nx-accent, #0d9488);
    border-color: var(--nx-accent, #0d9488);
    color: #fff;
}
.nexab-pf__nav:disabled { opacity: .32; pointer-events: none; }

/* ── Product card ───────────────────────────────────────────────────────── */
.nexab-cs-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--nx-border, #e5e7eb);
    border-radius: var(--nx-radius, 10px);
    overflow: hidden;
    background: var(--nx-bg, #fff);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.nexab-cs-card:hover {
    border-color: color-mix(in srgb, var(--nx-border, #e5e7eb) 50%, transparent);
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* Visual */
.nexab-cs-card__visual {
    position: relative;
    overflow: hidden;
    background: var(--nx-surface, #f7f8fb);
}
.nexab-cs-card--product .nexab-cs-card__visual {
    aspect-ratio: var(--nexab-csp-ratio, 3/4);
}
.nexab-cs-card__visual > a {
    display: block;
    width: 100%;
    height: 100%;
}
.nexab-cs-card__img-main {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .35s ease;
}
.nexab-cs-card:hover .nexab-cs-card__img-main { transform: scale(1.04); }
.nexab-cs-card__img-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 100%; min-height: 180px;
    color: var(--nx-border, #e5e7eb);
    font-size: 2.5rem;
}

/* Action overlay */
.nexab-cs-card__actions {
    position: absolute;
    top: .75rem; right: .75rem;
    display: flex;
    flex-direction: column;
    gap: .375rem;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 2;
}
.nexab-cs-card:hover .nexab-cs-card__actions {
    opacity: 1;
    transform: translateX(0);
}
.nexab-cs-card__act-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--nx-bg, #fff);
    border: 1px solid var(--nx-border, #e5e7eb);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    cursor: pointer;
    color: var(--nx-text, #374151);
    font-size: .875rem;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
    font-family: inherit;
    line-height: 1;
}
.nexab-cs-card__act-btn:hover {
    background: var(--nx-accent, #0d9488);
    border-color: var(--nx-accent, #0d9488);
    color: #fff;
    transform: scale(1.06);
}

/* Body */
.nexab-cs-card__body { flex: 1; padding: .875rem 1rem .5rem; }
.nexab-cs-card__name {
    display: block;
    margin: 0 0 .375rem;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--nx-heading, #10243d);
    line-height: 1.35;
    text-decoration: none;
    transition: color .2s ease;
}
.nexab-cs-card__name:hover { color: var(--nx-accent, #0d9488); }
.nexab-cs-card__badge {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--nx-muted, #6b7280);
    margin-bottom: .3125rem;
}

/* Price */
.nexab-csp__price { margin: .375rem 0 .5rem; }
.nexab-csp__price strong { font-size: 1.0625rem; font-weight: 800; color: var(--nx-heading, #10243d); }
.nexab-csp__price-from { font-size: .72rem; color: var(--nx-muted, #6b7280); margin-right: .125rem; }

/* Footer */
.nexab-cs-card__footer {
    padding: .75rem 1rem .9375rem;
    border-top: 1px solid var(--nx-border, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.nexab-csp__detail-btn {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--nx-muted, #6b7280);
    text-decoration: none;
    transition: color .15s;
    white-space: nowrap;
}
.nexab-csp__detail-btn:hover { color: var(--nx-accent, #0d9488); }
.nexab-csp__buy-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1rem;
    background: var(--nx-accent, #0d9488);
    color: #fff;
    border: none;
    border-radius: var(--nx-radius-sm, 6px);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: opacity .15s;
    white-space: nowrap;
    text-align: center;
}
.nexab-csp__buy-btn:hover { opacity: .88; color: #fff; }

/* SKU inline */
@keyframes nexab-pf-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.nexab-sku__loading {
    height: 28px; border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: nexab-pf-shimmer 1.4s ease-in-out infinite;
    margin-bottom: .5rem;
}
.nexab-sku__wrap { margin-bottom: .375rem; }
.nexab-sku__group { margin-bottom: .5rem; }
.nexab-sku__label { font-size: .72rem; color: var(--nx-muted, #6b7280); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.nexab-sku__label-val { color: var(--nx-heading, #10243d); font-weight: 600; text-transform: none; letter-spacing: 0; }
.nexab-sku__btns { display: flex; flex-wrap: wrap; gap: .3rem; }
.nexab-sku__btn {
    padding: .1875rem .625rem;
    font-size: .8rem;
    border: 1px solid var(--nx-border, #e5e7eb);
    border-radius: var(--nx-radius-sm, 6px);
    background: var(--nx-bg, #fff);
    color: var(--nx-text, #5a6577);
    cursor: pointer;
    line-height: 1.5;
    transition: border-color .15s, background .15s, color .15s;
    font-family: inherit;
}
.nexab-sku__btn:hover { border-color: var(--nx-accent, #0d9488); color: var(--nx-accent, #0d9488); }
.nexab-sku__btn.is-active {
    border-color: var(--nx-accent, #0d9488);
    background: var(--nx-accent, #0d9488);
    color: #fff;
}
.nexab-sku__btn--img {
    padding: 2px;
    width: 32px;
    height: 32px;
    overflow: hidden;
    flex-shrink: 0;
}
.nexab-sku__btn--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    pointer-events: none;
}
.nexab-sku__btn--img.is-active {
    box-shadow: 0 0 0 2px var(--nx-accent, #0d9488);
    background: transparent;
}
.nexab-sku__price { min-height: 28px; }
.nexab-sku__buy-wrap { display: contents; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .nexab-pf-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .nexab-pf__slider-track .nexab-cs-card { flex-basis: calc(50% - .625rem); }
}
@media (max-width: 767px) {
    .nexab-pf-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .nexab-pf__nav   { display: none; }
    .nexab-pf__slider-wrap { display: block; }
    .nexab-pf__slider-track { padding-bottom: 2px; }
    .nexab-pf__slider-track .nexab-cs-card { flex-basis: calc(50% - .625rem); }
}
@media (max-width: 399px) {
    .nexab-pf-cols-2, .nexab-pf-cols-3, .nexab-pf-cols-4 { grid-template-columns: 1fr; }
    .nexab-pf__slider-track .nexab-cs-card { flex-basis: calc(85% - .625rem); }
}
