/*
 * PROCOMP.LT Theme
 * Green accent (#22c55e) + Dark header (slate-800)
 * Loaded only for SITE_ID=4 via templates_site4/base.html
 */

/* Override primary color from sky-blue to green for procomp */
:root {
    --color-primary: #16a34a;       /* green-600 */
    --color-primary-50: #f0fdf4;
    --color-primary-100: #dcfce7;
    --color-primary-200: #bbf7d0;
    --color-primary-300: #86efac;
    --color-primary-400: #4ade80;
    --color-primary-500: #22c55e;
    --color-primary-600: #16a34a;
    --color-primary-700: #15803d;
    --color-primary-800: #166534;
    --color-primary-900: #14532d;

    /* Typography — site-consistent Inter throughout.
       Technical feel achieved via tabular-nums + letter-spacing, not font swap. */
    --font-display: 'Inter', system-ui, sans-serif;
    --font-mono: 'Inter', system-ui, sans-serif;

    /* Semantic */
    --ink: #0b1120;
    --muted: #64748b;
    --surface: #ffffff;
    --surface-sub: #f8fafc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
}

/* Product card hover (legacy, kept for other partials) */
.product-card {
    transition: all 0.2s ease;
}
.product-card:hover {
    box-shadow: 0 8px 25px -5px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Refurbished badge */
.badge-refurbished {
    display: inline-block;
    background-color: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ============================================================
   Refurbished carousel v2 — editorial/certified aesthetic
   ============================================================ */

.refurb-wrap {
    margin-top: 44px;
    --accent: var(--color-primary-600);
    max-width: 100%;
    overflow-x: hidden;
}
@media (min-width: 1024px) {
    .refurb-wrap { margin-top: 56px; }
}
.refurb-wrap {
    --grade-a: #16a34a;  /* green-600 — Kaip naujas */
    --grade-b: #2563eb;  /* blue-600 — Min. nusidėvėjimas */
    --grade-c: #d97706;  /* amber-600 — Naudojimo ženklai */
    --rail-fade: #fafafa;
    --shadow-card: 0 1px 2px rgba(15,23,42,0.04), 0 10px 30px -18px rgba(15,23,42,0.18);
    --shadow-card-hover: 0 2px 3px rgba(15,23,42,0.06), 0 28px 56px -20px rgba(15,23,42,0.22);
    font-feature-settings: "ss01" 1, "cv11" 1;
}

/* Header */
.refurb-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    min-width: 0;
}
.refurb-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}
.refurb-kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.refurb-kicker::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.refurb-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0;
    min-width: 0;
    overflow-wrap: break-word;
}
.refurb-title em {
    font-style: normal;
    color: var(--accent);
    font-weight: 700;
}

.refurb-viewall {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid currentColor;
    min-height: 44px;
    padding: 10px 0 8px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color .18s ease, gap .18s ease;
}
.refurb-viewall:hover {
    color: var(--accent);
    gap: 10px;
}
@media (max-width: 479px) {
    .refurb-title { font-size: 22px; }
    .refurb-viewall { font-size: 12px; gap: 4px; }
}
@media (min-width: 1024px) {
    .refurb-header { gap: 28px; }
    .refurb-header__actions { gap: 24px; }
}

/* Tabs — underline */
.refurb-tabbar {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding-inline: 2px;
    overscroll-behavior-inline: contain;
}
@media (min-width: 640px) { .refurb-tabbar { gap: 28px; } }
.refurb-tabbar::-webkit-scrollbar { display: none; }
.refurb-tab {
    position: relative;
    padding: 10px 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color .15s ease;
    font-feature-settings: "tnum" 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}
.refurb-tab::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .28s cubic-bezier(.2,.85,.2,1);
}
.refurb-tab:hover { color: var(--ink); }
.refurb-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}
.refurb-tab.is-active { color: var(--ink); font-weight: 600; }
.refurb-tab.is-active::after { transform: scaleX(1); }
.refurb-tab__count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    margin-left: 6px;
    font-weight: 400;
    letter-spacing: 0;
}

/* Legend — subtle inline */
.refurb-legend {
    display: none;
    gap: 18px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.refurb-header__actions .refurb-legend { display: none; }
@media (min-width: 1024px) {
    .refurb-header__actions .refurb-legend { display: flex; }
}
.refurb-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.refurb-legend__dot  { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* Rail wrap + fades */
.refurb-wrap > div {
    min-width: 0;
    max-width: 100%;
}

.refurb-rail-wrap {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}
.refurb-rail-wrap::before,
.refurb-rail-wrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 10px;
    width: 56px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity .2s ease;
}
.refurb-rail-wrap::before { left: 0;  background: linear-gradient(90deg,  var(--rail-fade) 10%, transparent); }
.refurb-rail-wrap::after  { right: 0; background: linear-gradient(270deg, var(--rail-fade) 10%, transparent); }
.refurb-rail-wrap[data-can-prev="true"]::before { opacity: 1; }
.refurb-rail-wrap[data-can-next="true"]::after  { opacity: 1; }

/* Rail — horizontal scroll container */
.refurb-rail {
    display: flex;
    position: relative;
    gap: 16px;
    overflow-x: auto;
    max-width: 100%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 2px 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding-left: 2px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}
.refurb-rail::-webkit-scrollbar { display: none; }
.refurb-rail:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 10px;
}

/* Arrows — float on hover, center-y */
.refurb-arrow {
    position: absolute;
    top: calc(50% - 12px);
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px -8px rgba(15,23,42,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease, background .2s ease, color .2s ease, border-color .2s ease;
    cursor: pointer;
    color: var(--ink);
}
.refurb-arrow[data-refurb-arrow="prev"] { left: 8px; }
.refurb-arrow[data-refurb-arrow="next"] { right: 8px; }
.refurb-rail-wrap:hover .refurb-arrow:not([disabled]),
.refurb-arrow:focus-visible { opacity: 1; }
.refurb-arrow:hover {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
    transform: translateY(-50%) scale(1.06);
}
.refurb-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.refurb-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
@media (max-width: 639px) { .refurb-arrow { display: none; } }

/* Dots pagination (segmented) */
.refurb-dots {
    display: flex;
    gap: 0;
    justify-content: flex-start;
    width: max-content;
    margin: 4px auto 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.refurb-dots[hidden] { display: none; }
.refurb-dots::-webkit-scrollbar { display: none; }
.refurb-dot {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.refurb-dot::before {
    content: '';
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: var(--line);
    transition: background .2s ease, width .24s ease;
}
.refurb-dot:hover::before { background: var(--line-strong); }
.refurb-dot.is-active::before {
    background: var(--ink);
    width: 32px;
}
.refurb-dot:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -4px;
    border-radius: 8px;
}

/* ======================= Product card v2 ======================= */

.refurb-card-v2 {
    --grade-color: #94a3b8;
    position: relative;
    flex: 0 0 min(62%, 232px);
    width: min(62%, 232px);
    max-width: 62%;
    min-width: 0;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 14px;
    box-shadow: var(--shadow-card);
    transition: transform .28s cubic-bezier(.2,.85,.2,1),
                box-shadow .28s cubic-bezier(.2,.85,.2,1),
                border-color .2s ease;
    scroll-snap-align: start;
    isolation: isolate;
    overflow: hidden;
}
@media (min-width: 480px) { .refurb-card-v2 { flex: 0 0 44%; max-width: 44%; } }
@media (min-width: 640px) { .refurb-card-v2 { flex: 0 0 232px; max-width: 232px; padding: 16px; } }
@media (min-width: 1024px){ .refurb-card-v2 { flex: 0 0 248px; max-width: 248px; } }

.refurb-card-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grade-color);
    opacity: 0.9;
    z-index: 2;
}
.refurb-card-v2--a     { --grade-color: var(--grade-a); }
.refurb-card-v2--b     { --grade-color: var(--grade-b); }
.refurb-card-v2--c     { --grade-color: var(--grade-c); }
.refurb-card-v2--plain::before { content: none; }

@media (hover: hover) {
    .refurb-card-v2:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-card-hover);
        border-color: var(--line-strong);
    }
    .refurb-card-v2:hover .refurb-card-v2__img { transform: scale(1.06); }
}

.refurb-card-v2 a.refurb-card-v2__link {
    display: block;
    border-radius: 8px;
    outline: none;
}
.refurb-card-v2 a.refurb-card-v2__link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.refurb-card-v2__imgwrap {
    aspect-ratio: 5 / 4;
    background: radial-gradient(ellipse at center top, #ffffff 0%, #f1f5f9 100%);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.refurb-card-v2__img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    transition: transform .6s cubic-bezier(.2,.85,.2,1);
    will-change: transform;
}
.refurb-card-v2__placeholder {
    width: 44%;
    height: 44%;
    color: #cbd5e1;
}

.refurb-card-v2__grade {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: white;
    background: var(--grade-color);
    padding: 3px 8px 3px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px -2px rgba(15,23,42,.25);
}
.refurb-card-v2__grade::before {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
}

.refurb-card-v2__title {
    font-size: 13.5px;
    line-height: 1.3;
    color: var(--ink);
    font-weight: 500;
    margin-top: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    transition: color .15s ease;
}
.refurb-card-v2:hover .refurb-card-v2__title { color: var(--accent); }

.refurb-card-v2__meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}

.refurb-card-v2__price {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    font-feature-settings: "tnum" 1;
    letter-spacing: -0.01em;
}
.refurb-card-v2__price-currency { opacity: .6; margin-right: 1px; font-weight: 500; }

.refurb-card-v2__stock {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding-bottom: 2px;
}
.refurb-card-v2__stock::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .refurb-rail { scroll-behavior: auto; }
    .refurb-card-v2,
    .refurb-card-v2__img,
    .refurb-arrow,
    .refurb-tab::after,
    .refurb-dot,
    .refurb-dot::before { transition: none !important; }
    .refurb-card-v2:hover { transform: none; }
    .refurb-card-v2:hover .refurb-card-v2__img { transform: none; }
}

/* Dragging state */
.refurb-rail-dragging {
    -webkit-user-select: none;
    user-select: none;
    cursor: grabbing;
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
}
.refurb-rail-dragging img,
.refurb-rail-dragging a { pointer-events: none; -webkit-user-drag: none; }
