/* ==========================================================
   CrossSell — Frontend CSS v1.1.1
   ========================================================== */

/* ── Section wrapper ───────────────────────────────────── */
.cs-product-sections {
    margin-top: 1.5rem;
}

.cs-product-sections #qty_form{
    display:none !important;
}

.cs-product-sections .product-miniature .product-description .btn{
    font-size: 12px !important;
}

.cs-product-sections .product-miniature .product-description .btn i{
    display:none;
}

.cs-product-sections .thumbnail-top{
    display:flex;
    flex-direction: column
}

.cs-product-sections .product-miniature .product-description{
    padding:0;
    flex: 1;
    height: 100%;
}

.cs-product-sections .js-product{
    border:none !important;
}

.cs-product-sections .add-to-cart-wrapper-product{
    margin-top:auto !important;
}

.cs-product-sections .product-miniature .product-title{
    height:56px;
}

.cs-section__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    padding: 0 8px;
}

.cs-section__title.h6,
h6.cs-section__title {
    padding: 0;
}

.cs-section__subtitle {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.75rem;
    padding: 0 8px;
}

/* ── Grid ──────────────────────────────────────────────── */
.cs-products--grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 1350px) {
    .cs-product-sections .cs-products--grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .cs-products--grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cs-product-wrap {
    min-width: 0;
    background: #fff;
    border-radius: 16px;
    padding: 12px
}

/* Miniatura musi być w pełni zawarta — nie wypadać poza wrap */
.cs-product-wrap .product-miniature,
.cs-slide .product-miniature {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Thumbnail container musi trzymać proporcje */
.cs-product-wrap .thumbnail-container,
.cs-slide .thumbnail-container {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom:0
}

/* Przycisk add-to-cart — zostaje wewnątrz miniaturki */
.cs-product-wrap .product-description,
.cs-slide .product-description {
    overflow: hidden;
}

.cs-product-wrap .add-to-cart,
.cs-slide .add-to-cart {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
    padding: 6px 8px;
}

/* ── Embla Carousel ────────────────────────────────────── */
.cs-embla {
    overflow: hidden;
    padding: 0 4px 8px;
}

.cs-embla__viewport {
    overflow: hidden;
    width: 100%;
}

.cs-embla__container {
    display: flex;
    gap: 12px;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    align-items: stretch;
}

.cs-slide {
    flex: 0 0 180px;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.cs-slide .product-miniature {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cs-slide .thumbnail-container {
    flex: 1;
}

@media (max-width: 576px) {
    .cs-slide {
        flex: 0 0 150px;
    }
}

/* ── Modal crosssell ───────────────────────────────────── */
.cs-modal-crosssell {
    border-top: 1px solid #e5e5e5;
    margin-top: 1rem;
    padding-top: 0;
}

.cs-modal-step__header {
    margin-bottom: 0.75rem;
    margin-top: 20px;
}

.cs-modal-crosssell .cs-slide {
    flex: 0 0 160px;
}

/* ── Progress dots ─────────────────────────────────────── */
.cs-popup__progress {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    padding: 0.6rem 0 0;
}

.cs-popup__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.2s;
}

.cs-popup__dot--active {
    background: #c00;
}

/* Ukryj tekst "Dodaj do koszyka" w przyciskach ramki CS i popupu */
.cs-product-wrap .add-to-cart span,
.cs-slide .add-to-cart span,
.cs-modal-crosssell .add-to-cart span {
    display: none;
}

/* ── Popup — przesuń CS nad przyciski koszyka ───────────── */
#blockcart-modal .modal-body {
    display: flex;
    flex-direction: column;
}

#blockcart-modal .modal-body > .cart-content-btn {
    order: 1;
    display: flex;
    justify-content: space-between;
    padding: 0 16px 16px 16px;
}

#blockcart-modal .cs-modal-crosssell {
    order: 0;
    border-bottom: none;
    margin-bottom: 0;

    border-top: none;
    margin-top: 0;

}

/* ============================================================
   Flash Sale (Gorący Strzał) — crosssell integration
   ============================================================ */

/* Karta flash sale */
.cs-flash-card {
    position: relative;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    height:100%;
}

.cs-flash-card__badge {
    position: absolute;
    top: 0px;
    left: 0px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 0 0 3px 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    width:100%;
    text-align: center;
}

.cs-flash-card__image-wrap {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
}

.cs-flash-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cs-flash-card__image-wrap:hover .cs-flash-card__image {
    transform: scale(1.04);
}

.cs-flash-card__body {
    padding: 10px 12px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-flash-card__name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cs-flash-card__variant {
    font-size: 12px;
    color: #888;
}

.cs-flash-card__prices {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    margin-top: auto;
    flex-wrap: wrap;
}

.cs-flash-card__price-promo {
    font-size: .9375rem;
    font-weight: 700;
    color: #e74c3c;
}

.cs-flash-card__price-old {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.cs-flash-card__price-30d {
    font-size: 11px;
    color: #999;
}

/* Pasek stock */
.cs-flash-card__stock {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cs-flash-card__stock-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.cs-flash-card__stock-fill {
    height: 100%;
    background: #e74c3c;
    border-radius: 3px;
    transition: width 0.5s;
}

.cs-flash-card__stock-label {
    font-size: 11px;
    color: #666;
}

/* Countdown */
.cs-flash-card__countdown {
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cs-flash-countdown-timer {
    font-weight: 700;
    color: #e74c3c;
    font-variant-numeric: tabular-nums;
}

.cs-flash-card__ended {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.cs-flash-card__footer {
    padding: 0;
}

.cs-flash-card__footer form {
    margin: 0;
}

body .btn.cs-flash-card__btn {
    width: 100%;
    background: #e74c3c;
    border-color: #e74c3c;
    padding: 8px 4px !important;
    font-size: 14px;
    border-radius:0 !important;
    font-size:12px
}

body .btn.cs-flash-card__btn:hover {
    background: #c0392b;
    border-color: #c0392b;
}

/* ── Grid: flash jako 1. kafelek ───────────────────────── */
.cs-flash-grid-item {
    /* dopasuj szerokość do innych kart w gridzie */
}

/* ── Karuzela: flash jako stały element z lewej ────────── */
.cs-section--carousel-with-flash {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cs-flash-fixed {
    flex: 0 0 200px;
    max-width: 200px;
}

.cs-section--carousel-with-flash .cs-embla {
    flex: 1;
    min-width: 0;
}

/* ── Modal koszyk ──────────────────────────────────────── */
.cs-modal-crosssell {
    display: block;
}

@media (max-width: 575px) {
    .cs-section--carousel-with-flash {
        flex-direction: column;
    }
    .cs-flash-fixed {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
}

/* Flash card — brak w magazynie */
.cs-flash-card--oos {
    opacity: 0.7;
}
.cs-flash-card--oos .cs-flash-card__badge {
    background: #95a5a6;
}
.cs-flash-card--oos .cs-flash-card__price-promo {
    color: #95a5a6;
}
/* =========================================================
   CROSSSELL POPUP - WHITESNUS / PS9
   ========================================================= */

/* Grid zawsze 3 równe kolumny na desktop */
.cs-modal-crosssell .cs-products--grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
}

/* Każdy slot faktycznie wypełnia swoją 1/3 szerokości */
.cs-modal-crosssell .cs-product-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.cs-modal-crosssell .cs-product-wrap .product-miniature,
.cs-modal-crosssell .cs-product-wrap .card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* Zdjęcie */
.cs-modal-crosssell .product-miniature__image-container {
    width: 100% !important;
}

.cs-modal-crosssell .product-miniature__image {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* =========================================================
   WYŁĄCZENIE WIELOSZTUK
   ========================================================= */

/*
 * Ukrywamy tylko kafelki:
 * 1 PUSZKA / 5 PUSZEK / 10 PUSZEK / 20 PUSZEK
 *
 * NIE ukrywamy całego formularza, bo zostawiamy
 * zwykły przycisk "Dodaj do koszyka".
 */
.cs-modal-crosssell .pm-wst-tiers {
    display: none !important;
}

/* Formularz po usunięciu wielosztuk */
.cs-modal-crosssell .pm-wst-form {
    width: 100% !important;
    margin: 12px 0 0 !important;
}

/* Przycisk dodania do koszyka */
.cs-modal-crosssell .pm-wst-atc {
    width: 100% !important;
}

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

@media (max-width: 575px) {
    .cs-modal-crosssell .cs-products--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* =========================================================
   CROSSSELL POPUP PRODUCT CARD
   ========================================================= */

.cs-modal-crosssell .cs-products--grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

/* Wrapper generowany przez JS */
.cs-modal-crosssell .cs-product-wrap {
    min-width: 0;
    width: 100%;
    height: 100%;
}

/* Cały kafelek */
.cs-popup-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Zdjęcie */
.cs-popup-card__image-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.cs-popup-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

/* Dolna część karty */
.cs-popup-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

/* Nazwa */
.cs-popup-card__name {
    display: block;

    min-height: 60px;
    height: 60px;

    color: inherit;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    text-decoration: none;

    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;

    overflow: hidden;
    text-overflow: clip;
}

/*
 * Najważniejsze:
 * margin-top:auto dociska cenę i przycisk
 * do dołu każdej karty.
 */
.cs-popup-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: 12px;
}

/* Cena po lewej */
.cs-popup-card__price {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Formularz */
.cs-popup-card__form {
    flex: 0 0 auto;
    margin: 0;
}

/* Sam przycisk z ikoną koszyka */
.cs-popup-card__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--snusowo-accent);
    color: #111111;
    cursor: pointer;
}

.cs-popup-card__add:hover {
    background: var(--snusowo-accent);
}

.cs-popup-card__add svg {
    display: block;
}

/* Mobile */
@media (max-width: 575px) {
    .cs-modal-crosssell .cs-products--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

/* =========================================================
   SZERSZY MODAL KOSZYKA NA DESKTOP
   ========================================================= */

@media (min-width: 992px) {
    #blockcart-modal {
        --bs-modal-width: 800px !important;
    }

    #blockcart-modal .modal-dialog {
        width: 800px !important;
        max-width: calc(100vw - 48px) !important;
    }
}