.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    float: left;
    margin: 0 3.8% 2.992em 0;
    padding: 0;
    position: relative;
    width: 100%!important;
    margin-left: 0;
}
/* =========================================================
   KRYSTALSPACE – PRODUCT CARD (v2.0)
   Template: content-product.php
========================================================= */

/* KONTENER LI */
.ks-product-card {
    list-style: none;
}

/* GŁÓWNA KARTA */
.ks-product-inner {
    background: var(--ks-white);
    border-radius: 24px;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ks-border);
    box-shadow: var(--ks-shadow);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
    position: relative;
    overflow: hidden;
}

.ks-product-card:hover .ks-product-inner {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(59,130,246,.15);
    border-color: var(--ks-blue);
}

/* GLASS EFFECT */
.ks-product-inner.glass-effect {
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(12px);
}

/* =========================================================
   IMAGE + MEDIA
========================================================= */

.ks-product-img-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--ks-bg-light);
}

/* LINK + IMG */
.ks-img-link {
    display: block;
}

.ks-product-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .6s ease;
}

.ks-product-card:hover .ks-product-image {
    transform: scale(1.08);
}

/* =========================================================
   BADGES
========================================================= */

.ks-product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.ks-badge {
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 50px;
    color: #fff;
    letter-spacing: .4px;
}

.ks-badge-sale { background: var(--ks-error); }
.ks-badge-bestseller { background: var(--ks-yellow); }
.ks-badge-out { background: var(--ks-slate); }

/* =========================================================
   WISHLIST (YITH)
========================================================= */

.ks-wishlist-pos {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
}

.ks-wishlist-pos a {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
    transition: .3s;
}

.ks-wishlist-pos a:hover {
    background: var(--ks-blue);
    color: #fff !important;
}

/* =========================================================
   ACTION BUTTONS (OVERLAY)
========================================================= */

.ks-card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    background: linear-gradient(to top, rgba(255,255,255,.95), transparent);
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    transition: transform .35s ease;
}

.ks-product-card:hover .ks-card-actions {
    transform: translateY(0);
}

.ks-btn-cart,
.ks-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--ks-gradient);
    box-shadow: 0 10px 25px rgba(59,130,246,.25);
}

.ks-btn-cart:hover,
.ks-btn-view:hover {
    transform: translateY(-2px);
}

/* =========================================================
   CARD BODY
========================================================= */

.ks-card-body {
    padding: 16px 6px 6px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* META */
.ks-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ks-card-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--ks-blue);
    text-transform: uppercase;
}

.ks-attr-tag {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--ks-bg-light);
    border-radius: 6px;
    color: var(--ks-slate);
    font-weight: 600;
}

/* TITLE */
.ks-product-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.3;
}

.ks-product-title a {
    color: var(--ks-navy);
}

.ks-product-title a:hover {
    color: var(--ks-blue);
}

/* DESC */
.ks-product-desc {
    font-size: 13px;
    color: var(--ks-slate);
    line-height: 1.5;
    margin-bottom: 14px;
}

/* =========================================================
   FOOTER
========================================================= */

.ks-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--ks-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ks-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--ks-navy);
}

.ks-price del {
    font-size: 14px;
    opacity: .5;
    margin-right: 4px;
}

.ks-price ins {
    text-decoration: none;
}

/* STOCK */
.ks-stock-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.ks-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
}

.instock .ks-dot { background: var(--ks-green); }
.outofstock .ks-dot { background: var(--ks-error); }

.instock .ks-status-text { color: var(--ks-green); }
.outofstock .ks-status-text { color: var(--ks-error); }

/* =========================================================
   MOBILE FIX
========================================================= */

@media (max-width: 768px) {
    .ks-card-actions {
        position: static;
        transform: none;
        background: none;
        padding: 12px 0 0;
    }

    .ks-btn-cart,
    .ks-btn-view {
        width: 100%;
        justify-content: center;
    }
}

/* =================================================
   CONTENT PRODUCT – KRYSTALSPACE (RELATED / GRID)
================================================= */

/* --- SEKCJA PRODUKTÓW POWIĄZANYCH --- */
.ks-related-products {
    margin-top: 100px;
    padding-top: 80px;
    border-top: 1px solid #f1f5f9;
    position: relative;
}

/* --- NAGŁÓWEK SEKCJI --- */
.ks-related-products .section-header {
    margin-bottom: 60px;
    text-align: center;
}

.ks-related-products .related-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    color: var(--ks-navy);
    line-height: 1.2;
}

/* Gradient tekst */
.ks-related-products .gradient-text {
    background: var(--ks-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Linia dekoracyjna */
.ks-related-products .header-line {
    width: 60px;
    height: 4px;
    background: var(--ks-gradient);
    margin: 25px auto;
    border-radius: 10px;
    opacity: 0.8;
}

/* =================================================
   GRID PRODUKTÓW
================================================= */

.ks-related-products ul.products {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
}

/* Czyścimy clearfix WooCommerce */
.ks-related-products ul.products::before,
.ks-related-products ul.products::after {
    display: none !important;
}

/* =================================================
   FALLBACK – BRAK PRODUKTÓW
================================================= */

.ks-no-related {
    text-align: center;
    padding: 60px 40px;
    border-radius: 30px;
    background: rgba(248, 250, 252, 0.6);
    border: 2px dashed #e2e8f0;
    backdrop-filter: blur(10px);
}

.ks-no-related p {
    font-size: 16px;
    color: var(--ks-slate);
    margin: 0;
}

.ks-no-related .ks-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--ks-blue);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ks-no-related .ks-link:hover {
    color: var(--ks-green);
    transform: translateX(5px);
}

/* =================================================
   RESPONSYWNOŚĆ
================================================= */

@media (max-width: 1024px) {
    .ks-related-products {
        margin-top: 60px;
        padding-top: 40px;
    }

    .ks-related-products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 600px) {
    .ks-related-products .section-header {
        margin-bottom: 40px;
    }

    .ks-related-products ul.products {
        grid-template-columns: 1fr !important;
        padding: 0 10px !important;
    }

    .ks-related-products .related-title {
        font-size: 26px;
    }
}

/* =================================================
   ANIMACJA (REVEAL – TWÓJ JS)
================================================= */

.ks-related-products.reveal-init {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ks-related-products.reveal-init.is-visible {
    opacity: 1;
    transform: translateY(0);
}
