/* =========================================================
   KAKOFIND — OFERTY SPECJALNE (sekcja na stronie głównej)
   Wyświetla się NAD "Przeglądaj kategorie". Slider zweryfikowanych
   promocji (do 10+ kart) sterowany z panelu admina/sprzedawcy.
   Paleta spójna z resztą: czerń #050505 / czerwień #E60000·#FF2D2D.
   ========================================================= */

.special-offers {
    position: relative;
    padding: 64px 0 56px;
    overflow: hidden;
    isolation: isolate;
}

/* Wyróżniające, ale spójne tło: czerwona poświata u góry + delikatne
   pasy „taśmy ostrzegawczej” w rogach, żeby od razu krzyczało SALE. */
.special-offers::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 70% 60% at 50% -8%, rgba(230, 0, 0, 0.18), transparent 62%),
        radial-gradient(circle at 92% 14%, rgba(255, 45, 45, 0.10), transparent 40%),
        linear-gradient(180deg, rgba(230, 0, 0, 0.05), transparent 30%);
    pointer-events: none;
}
.special-offers::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 25%, transparent 78%);
    opacity: 0.5;
    pointer-events: none;
}

.so-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* Maskotka biegnąca (FAST) — dekoracyjna, w prawym górnym rogu */
.so-deco-fast {
    position: absolute;
    top: -34px;
    right: 8px;
    width: 168px;
    height: auto;
    opacity: 0.92;
    pointer-events: none;
    filter: drop-shadow(0 14px 26px rgba(230, 0, 0, 0.28));
    z-index: 1;
    animation: soFloat 6s ease-in-out infinite;
}

@keyframes soFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-10px) rotate(1deg); }
}

/* ---------- Nagłówek ---------- */
.so-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 26px;
}

.so-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #E60000, #8A0000);
    border: 1px solid rgba(255, 90, 90, 0.45);
    box-shadow: 0 0 0 1px rgba(230, 0, 0, 0.18), 0 10px 26px rgba(230, 0, 0, 0.30);
}
.so-badge i { font-size: 0.85rem; animation: soPulse 1.8s ease-in-out infinite; }
@keyframes soPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.18); opacity: 0.82; }
}

.so-title {
    margin: 0;
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.5px;
    color: #f5f5f5;
}
.so-title .text-red {
    background: linear-gradient(120deg, #FF2D2D, #E60000 60%, #FF6a6a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.so-subtitle {
    margin: 0;
    max-width: 640px;
    color: var(--kf-muted, #9a9a9a);
    font-size: 1rem;
    line-height: 1.55;
}

/* ---------- „Literka” + opis (callout zaufania) ---------- */
.so-intro {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 940px;
    margin: 0 auto 34px;
    padding: 18px 24px 18px 18px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(230, 0, 0, 0.08), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(230, 0, 0, 0.22);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}
.so-intro::before {
    /* czerwona „taśma” po lewej */
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #FF2D2D, #8A0000);
}

.so-intro__art {
    flex-shrink: 0;
    width: 118px;
    height: 118px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(230, 0, 0, 0.3));
    animation: soFloat 5s ease-in-out infinite;
}

.so-intro__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.so-intro__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #FF6a6a;
}
.so-intro__title i { color: #2ecc71; }
.so-intro__desc {
    margin: 0;
    color: #d9d9d9;
    font-size: 0.96rem;
    line-height: 1.6;
}
.so-intro__desc strong { color: #fff; }

/* ---------- Pasek narzędzi: filtry + nawigacja ---------- */
.so-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.so-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.so-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--kf-line, rgba(255, 255, 255, 0.1));
    color: #cfcfcf;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}
.so-filter i { font-size: 0.82rem; opacity: 0.85; }
.so-filter:hover { border-color: rgba(230, 0, 0, 0.5); color: #fff; transform: translateY(-1px); }
.so-filter.is-active {
    background: linear-gradient(135deg, #E60000, #8A0000);
    border-color: rgba(255, 90, 90, 0.5);
    color: #fff;
    box-shadow: 0 8px 20px rgba(230, 0, 0, 0.28);
}

.so-nav {
    display: flex;
    gap: 8px;
}
.so-nav-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--kf-line, rgba(255, 255, 255, 0.12));
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.so-nav-btn:hover:not(:disabled) {
    background: #E60000;
    border-color: #E60000;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(230, 0, 0, 0.35);
}
.so-nav-btn:disabled { opacity: 0.32; cursor: default; }

/* ---------- Slider / rail ---------- */
.so-rail-wrap { position: relative; }
.so-rail {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 4px 22px;
    margin: 0 -4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.so-rail::-webkit-scrollbar { display: none; }

/* Miękkie wygaszenie krawędzi railu, sugeruje „jest więcej” */
.so-rail-wrap::before,
.so-rail-wrap::after {
    content: "";
    position: absolute;
    top: 0; bottom: 22px;
    width: 46px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.so-rail-wrap::before { left: -4px; background: linear-gradient(90deg, #050505, transparent); }
.so-rail-wrap::after { right: -4px; background: linear-gradient(270deg, #050505, transparent); }
.so-rail-wrap.at-start::before { opacity: 0; }
.so-rail-wrap.at-end::after { opacity: 0; }

/* ---------- Karta promocji ---------- */
.so-card {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: clamp(240px, 80vw, 286px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--kf-line, rgba(255, 255, 255, 0.09));
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.28s ease, box-shadow 0.28s ease;
}
.so-card:hover {
    transform: translateY(-6px);
    border-color: rgba(230, 0, 0, 0.55);
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(230, 0, 0, 0.25);
}

.so-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #0c0c0c;
    overflow: hidden;
}
.so-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.so-card:hover .so-card__media img { transform: scale(1.06); }

/* Wstążka zniżki */
.so-card__disc {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 7px 12px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 1.02rem;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, #FF2D2D, #B00000);
    box-shadow: 0 8px 18px rgba(230, 0, 0, 0.45);
    letter-spacing: -0.5px;
}
.so-card__disc small { font-size: 0.6rem; font-weight: 800; opacity: 0.92; }

/* Tag „Nowość” */
.so-card__new {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #07210f;
    background: linear-gradient(135deg, #4dffa3, #19c46a);
    box-shadow: 0 6px 14px rgba(25, 196, 106, 0.35);
}

.so-card__body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px 15px 16px;
    flex: 1;
}

.so-card__name {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.so-card__desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--kf-muted, #9a9a9a);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.so-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--kf-muted, #9a9a9a);
}
.so-card__rating { color: #ffc83d; font-weight: 700; }
.so-card__rating i { font-size: 0.72rem; }

.so-card__prices {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-top: auto;
    flex-wrap: wrap;
}
.so-card__price-new {
    font-size: 1.32rem;
    font-weight: 900;
    color: #FF4040;
    letter-spacing: -0.5px;
}
.so-card__price-old {
    font-size: 0.9rem;
    color: #8c8c8c;
    text-decoration: line-through;
    text-decoration-color: rgba(230, 0, 0, 0.6);
}
.so-card__save {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
    color: #4dffa3;
    background: rgba(25, 196, 106, 0.12);
    border: 1px solid rgba(25, 196, 106, 0.3);
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

/* Pasek dostępności (limit sztuk) */
.so-card__stock { display: flex; flex-direction: column; gap: 5px; }
.so-card__stock-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.so-card__stock-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #FF2D2D, #FFA53d);
}
.so-card__stock-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffb35c;
}
.so-card__stock-label i { font-size: 0.68rem; }

.so-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #E60000, #B00000);
    border: 1px solid rgba(255, 90, 90, 0.4);
    transition: filter 0.2s ease, transform 0.2s ease;
}
.so-card:hover .so-card__cta { filter: brightness(1.12); }
.so-card__cta i { transition: transform 0.2s ease; }
.so-card:hover .so-card__cta i { transform: translateX(3px); }

/* ---------- CTA na koniec listy ---------- */
.so-foot {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* ---------- Stan: ładowanie ---------- */
.so-skeleton {
    flex: 0 0 auto;
    width: clamp(240px, 80vw, 286px);
    height: 380px;
    border-radius: 18px;
    background: linear-gradient(100deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 70%);
    background-size: 200% 100%;
    animation: soShimmer 1.3s linear infinite;
}
@keyframes soShimmer { to { background-position: -200% 0; } }

/* ---------- Wejście sekcji ---------- */
.special-offers .so-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.special-offers.is-revealed .so-reveal { opacity: 1; transform: none; }
.special-offers.is-revealed .so-reveal:nth-child(2) { transition-delay: 0.06s; }
.special-offers.is-revealed .so-reveal:nth-child(3) { transition-delay: 0.12s; }

/* ---------- Responsywność ---------- */
@media (max-width: 900px) {
    .so-deco-fast { width: 120px; top: -20px; right: 0; }
}

@media (max-width: 720px) {
    .special-offers { padding: 48px 0 42px; }
    .so-intro {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 20px 18px;
    }
    .so-intro__text { text-align: center; }
    .so-intro__title { justify-content: center; }
    .so-intro__art { width: 96px; height: 96px; }
    .so-deco-fast { display: none; }
    .so-nav { display: none; }
    .so-card { width: clamp(220px, 78vw, 260px); }
    .so-toolbar { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .so-deco-fast, .so-intro__art, .so-badge i { animation: none; }
    .special-offers .so-reveal { transition: opacity 0.3s ease; transform: none; }
    .so-card, .so-card__media img { transition: none; }
}
