/*
 * cards-carousel.css — czyste przepisanie
 * Karta produktu, karuzela, wyszukiwarka
 */

/* ============================================================
   WYSZUKIWARKA — 8px radius
   ============================================================ */
.ds-header__search .dgwt-wcas-sf-wrapp { border-radius: 8px; overflow: hidden; display: flex; }
.ds-header__search input.dgwt-wcas-search-input { border-radius: 8px 0 0 8px !important; border-right: none !important; }
.ds-header__search button.dgwt-wcas-search-submit { border-radius: 0 8px 8px 0 !important; width: 100px !important; flex: 0 0 100px !important; font-size: 14px !important; font-weight: 700 !important; font-family: 'Inter', sans-serif !important; }

/* ============================================================
   KARTA PRODUKTU — równa wysokość, % badge, omnibus, ceny
   ============================================================ */

/* Kontener karuzeli: equal-height items */
.ds-carousel__track { display: flex; align-items: stretch; }
.ds-carousel__item  { display: flex; flex-direction: column; }

/* Karta: flex column, 100% wysokości */
.ds-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    transition: box-shadow .15s;
}
.ds-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }

/* Link zajmuje całą górną część */
.ds-product-card__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

/* Zdjęcie */
.ds-product-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #fff;
}
.ds-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
    padding: 8px;
    box-sizing: border-box;
}

/* % badge */
.ds-badge--pct {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #F65F0A;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 2;
    line-height: 1.3;
    font-family: 'Inter', sans-serif;
}

/* Treść karty */
.ds-product-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 8px;
    gap: 5px;
}

/* Tytuł */
.ds-product-card__title {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #111 !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cena */
.ds-product-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}
.ds-product-card__price .woocommerce-Price-amount {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #111 !important;
}
/* Cena promocyjna (ins) — zielona */
.ds-product-card__price ins .woocommerce-Price-amount,
.ds-product-card__price .woocs_price_code ins .woocommerce-Price-amount {
    color: #00813a !important;
    font-size: 18px !important;
    font-weight: 800 !important;
}
/* Stara cena (del) — mała i szara */
.ds-product-card__price del .woocommerce-Price-amount,
.ds-product-card__price .woocs_price_code del .woocommerce-Price-amount {
    font-size: 12px !important;
    color: #999 !important;
    font-weight: 400 !important;
}
.ds-product-card__price del { text-decoration: line-through; opacity: .7; }
.ds-product-card__price ins { text-decoration: none; }

/* Omnibus */
.ds-product-card__omnibus {
    font-size: 10px;
    color: #999;
    line-height: 1.3;
}
.ds-product-card__omnibus .woocommerce-Price-amount { font-size: 10px !important; color: #999 !important; font-weight: 400 !important; }

/* Dostawa — wypycha się na dół */
.ds-product-card__delivery {
    margin-top: auto;
    padding-top: 6px;
    font-size: 12px;
    color: #555;
}
.ds-product-card__delivery strong { color: #00813a; font-weight: 700; }

/* Footer karty */
.ds-product-card__footer {
    padding: 8px 12px 12px;
    border-top: 1px solid #f0f0f0;
    margin-top: 0;
}
.ds-product-card__footer .ds-btn { display: block; width: 100%; text-align: center; padding: 9px; font-size: 12px; font-weight: 700; border-radius: 6px; }

/* ============================================================
   KARUZELA — ostatnia karta 30% peek
   ============================================================ */
.ds-carousel {
    position: relative;
    overflow: hidden;
}

.ds-carousel__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 12px;
    padding: 4px 2px 8px;
    /* Trick: padding-right = szerokość ~30% ostatniej karty */
}
.ds-carousel__track::-webkit-scrollbar { display: none; }

/*
 * 4 karty widoczne + 30% piątej
 * Wzór: flex-basis = (container - gaps) / 4.3
 * Uproszczenie: używamy % z calc
 */
.ds-carousel__item {
    flex: 0 0 calc((100% - 3 * 12px) / 4.3);
    scroll-snap-align: start;
    min-width: 160px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1200px) {
    .ds-carousel__item { flex: 0 0 calc((100% - 2 * 12px) / 3.3); }
}
@media (max-width: 900px) {
    .ds-carousel__item { flex: 0 0 calc((100% - 12px) / 2.3); }
}
@media (max-width: 600px) {
    .ds-carousel__item { flex: 0 0 calc(100% / 1.3); }
}

/* Strzałki karuzeli */
.ds-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all .15s;
}
.ds-carousel__btn:hover { background: #F65F0A; border-color: #F65F0A; color: #fff; }
.ds-carousel__btn--prev { left: 6px; }
.ds-carousel__btn--next { right: 6px; }
