.nvkpc-root {
    --nvkpc-visible-columns: 8;
    --nvkpc-rows: 2;
    --nvkpc-column-gap: 18px;
    --nvkpc-row-gap: 10px;
    --nvkpc-image-size: 112px;
    --nvkpc-title-gap: 7px;
    direction: rtl;
    width: 100%;
    max-width: 100%;
    position: relative;
    box-sizing: border-box;
}

.nvkpc-root *,
.nvkpc-root *::before,
.nvkpc-root *::after {
    box-sizing: border-box;
}

.nvkpc-heading {
    text-align: center;
    line-height: 1.6;
    font-weight: 700;
    color: #12385a;
}

.nvkpc-shell {
    position: relative;
    width: 100%;
    max-width: 100%;
    isolation: isolate;
}

/* RTL carousel hint: more pages continue to the left side. */
.nvkpc-shell::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 34px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.72) 42%, rgba(255, 255, 255, 0) 100%);
    transition: opacity 180ms ease;
}

.nvkpc-root.nvkpc-has-overflow .nvkpc-shell::before {
    opacity: 1;
}

.nvkpc-root.nvkpc-at-last-page .nvkpc-shell::before {
    opacity: 0;
}

.nvkpc-track {
    direction: rtl;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.nvkpc-track::-webkit-scrollbar {
    display: none;
}

.nvkpc-track:focus {
    outline: none;
}

/* No-JS/editor fallback: still keeps columns and rows instead of a broken one-line list. */
.nvkpc-track:not(.nvkpc-track-ready) {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--nvkpc-rows), max-content);
    grid-auto-columns: minmax(0, calc((100% - (var(--nvkpc-column-gap) * (var(--nvkpc-visible-columns) - 1))) / var(--nvkpc-visible-columns)));
    gap: var(--nvkpc-row-gap) var(--nvkpc-column-gap);
    padding: 2px 0 8px;
}

/* Real carousel mode: JS groups items into full-width pages. */
.nvkpc-track.nvkpc-track-ready {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
}

.nvkpc-page {
    direction: rtl;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    display: grid;
    grid-template-columns: repeat(var(--nvkpc-visible-columns), minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: var(--nvkpc-row-gap) var(--nvkpc-column-gap);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 2px 0 8px;
}

.nvkpc-item {
    min-width: 0;
    max-width: 100%;
}

.nvkpc-card,
.nvkpc-card:hover,
.nvkpc-card:focus,
.nvkpc-card:active,
.nvkpc-card:visited {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    text-decoration: none !important;
    color: inherit;
    box-shadow: none !important;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.nvkpc-image-box {
    width: min(var(--nvkpc-image-size), 100%);
    aspect-ratio: 1 / 1;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible;
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.nvkpc-image-box img,
.nvkpc-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.nvkpc-image-placeholder {
    background: transparent;
}

.nvkpc-title {
    display: block;
    width: 100%;
    margin-top: var(--nvkpc-title-gap);
    line-height: 1.7;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.nvkpc-editor-message {
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff8e5;
    color: #6b4e00;
    border: 1px solid #ffe2a6;
    font-size: 13px;
    line-height: 1.8;
    direction: rtl;
}

@media (max-width: 1024px) {
    .nvkpc-root {
        --nvkpc-visible-columns: 5;
    }
}

@media (max-width: 767px) {
    .nvkpc-root {
        --nvkpc-visible-columns: 3;
        --nvkpc-column-gap: 12px;
        --nvkpc-row-gap: 10px;
        --nvkpc-image-size: 86px;
    }

    .nvkpc-track {
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto;
        touch-action: auto;
    }

    .nvkpc-title {
        font-size: 12px;
        line-height: 1.65;
    }
}

/* Lightweight navigation indicators: dots or a small visual scrollbar. */
.nvkpc-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 7px;
}

.nvkpc-root.nvkpc-has-overflow .nvkpc-indicator {
    display: flex;
}

.nvkpc-dots {
    gap: 6px;
    min-height: 16px;
    direction: rtl;
}

.nvkpc-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(18, 56, 90, 0.28);
    box-shadow: none;
    cursor: pointer;
    transition: width 180ms ease, background-color 180ms ease, opacity 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.nvkpc-dot.is-active {
    width: 18px;
    background: rgba(18, 56, 90, 0.78);
}

.nvkpc-dot:focus {
    outline: none;
}

.nvkpc-scrollbar {
    min-height: 15px;
    padding: 4px 0 2px;
}

.nvkpc-scrollbar-track {
    position: relative;
    display: block;
    width: 66px;
    height: 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.13);
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    touch-action: manipulation;
}

.nvkpc-scrollbar-thumb {
    position: absolute;
    top: 0;
    bottom: 0;
    right: var(--nvkpc-scrollbar-thumb-right, 0%);
    width: var(--nvkpc-scrollbar-thumb-width, 100%);
    min-width: 16px;
    border-radius: inherit;
    background: rgba(18, 56, 90, 0.72);
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.16);
    transition: right 180ms ease, width 180ms ease, background-color 180ms ease;
}

.nvkpc-scrollbar-track:hover .nvkpc-scrollbar-thumb,
.nvkpc-scrollbar-track:focus .nvkpc-scrollbar-thumb {
    background: rgba(18, 56, 90, 0.88);
}

@media (max-width: 767px) {
    .nvkpc-indicator {
        margin-top: 5px;
    }

    .nvkpc-scrollbar-track {
        width: 58px;
        height: 4px;
    }

    .nvkpc-scrollbar-thumb {
        min-width: 14px;
    }
}

/* Category carousel fractional/free-scroll mode.
   This allows values like 3.5 columns and avoids invalid CSS repeat(3.5) layouts.
   The image box remains square and capped by item width to avoid white-space issues. */
.nvkpc-root .nvkpc-track.nvkpc-track-free,
.nvkpc-root .nvkpc-track.nvkpc-track-ready.nvkpc-track-free {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-template-rows: repeat(var(--nvkpc-rows), max-content) !important;
    grid-auto-columns: calc((100% - ((var(--nvkpc-visible-columns) - 1) * var(--nvkpc-column-gap))) / var(--nvkpc-visible-columns)) !important;
    gap: var(--nvkpc-row-gap) var(--nvkpc-column-gap) !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
}

.nvkpc-root .nvkpc-track.nvkpc-track-free > .nvkpc-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.nvkpc-root .nvkpc-track.nvkpc-track-free .nvkpc-image-box {
    width: min(var(--nvkpc-image-size), 100%) !important;
    max-width: 100% !important;
}

@media (max-width: 767px) {
    .nvkpc-root {
        --nvkpc-visible-columns: 3.5;
        --nvkpc-image-size: min(var(--nvkpc-image-size), 76px);
    }

    .nvkpc-root .nvkpc-track,
    .nvkpc-root .nvkpc-track.nvkpc-track-ready {
        scroll-snap-type: none !important;
        scroll-behavior: auto;
    }
}
