/* SALEPIX Product Extend - Modern Card Layout */

/* Grid Container */
.spx-products-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Scrollable Grid - ALWAYS VISIBLE SCROLLBAR */
.spx-products-grid.spx-scrollable {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

/* Expandable Grid - "More" Button Mode */
.spx-products-grid.spx-expandable {
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease-out;
}

.spx-products-grid.spx-expandable.spx-expanded {
    overflow: visible;
}

/* Custom Scrollbar - Webkit (Safari, Chrome) - FORCE VISIBILITY */
.spx-products-grid.spx-scrollable::-webkit-scrollbar {
    -webkit-appearance: none !important;
    width: 10px !important;
}

.spx-products-grid.spx-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.spx-products-grid.spx-scrollable::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 8px;
}

.spx-products-grid.spx-scrollable::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Product Card */

.spx-product-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid transparent;
    background: #f8f9fa;
    transition: all 0.2s ease;

}

.spx-product-card .productbox-prices_netto {
    display: none;
}

.spx-product-card .productbox-price {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.spx-product-card .spx-discount-badge {
    font-size: .9rem;
    margin-top: 0.25rem;
}

.spx-product-card:hover {
    background: #f2f2f2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Clickable Card */
.spx-product-card-clickable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Selected Card */
.spx-card-selected {
    background: var(--slpx-counter-background, #f2f2f2) !important;
    border-radius: 4px;
    border: 2px solid;
}

/* Card with Checkbox */
.spx-product-card-with-checkbox {
    padding-left: 0.75rem;
}

/* Checkbox */
.spx-product-checkbox {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.spx-product-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

/* Product Image */
.spx-product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.spx-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product Info */
.spx-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.spx-product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    @media (max-width: 768px) {
        flex-direction: column;
        gap: 0;
        align-items: start;
    }
}

.spx-discount-badge {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
}

.spx-product-discount-flag {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

.splx-group-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

input.form-control.spx-addon-quantity {
    padding: 5px;
}

/* Product Name */
/* Product Price Row */
/* Product Price Wrapper */
.spx-product-price-wrapper {
    font-size: 1.1rem;
    font-weight: 500;
}

.spx-price-original {
    text-decoration: line-through;
    font-size: 1rem;
}

.spx-price-discounted .js-product-counter-price {
    color: var(--slpx-color-primary, #212529);
    font-weight: 600;
}

.spx-product-price-wrapper .price_wrapper {
    margin: 0;
}

.spx-addon-counter {
    width: 150px;
    margin-top: 5px;

    @media (max-width: 768px) {
        width: 100%;
    }
}

.spx-addon-counter input {
    text-align: center;
}

.spx-product-price-wrapper .price {
    font-size: 1rem;
    font-weight: 600;
}

.spx-addon-qty-btn {
    padding: 5px;
}

.spx-addon-qty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 1rem;
    line-height: 1;
    font-weight: 600;
}

.spx-product-price-wrapper .price-old {
    font-size: 0.85rem;
}

.spx-product-price-wrapper .vat_info {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Product Price */
/* Product Quantity Dropdown */
.spx-product-quantity {
    flex-shrink: 0;
    text-align: center;
}

.spx-addon-quantity {
    appearance: textfield;
    -moz-appearance: textfield;
}

.spx-addon-quantity::-webkit-outer-spin-button,
.spx-addon-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Service Group */
/* Expand Button Container */
.spx-expand-btn-container {
    margin-top: 1rem;
}

/* Hide button after expansion */
.spx-expand-btn.spx-hidden {
    display: none;
}

/* Responsive */
@media (max-width: 576px) {
    .spx-product-card {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .spx-product-image {
        width: 60px;
        height: 60px;
    }
}

.spx_cart__basket-items .spx-product-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spx_cart__basket-items .spx-product-quantity .spx-addon-counter {
    @media (min-width: 768px) {
        margin-top: 0;
        padding: 0;
        height: 34px;
    }
}

/* =====================================================
   SPX Bild-Zoom Popup
   ===================================================== */

/* Zoom-Cursor und relativer Container für das Hint-Icon */
.spx-product-image {
    position: relative;
    cursor: zoom-in;
}

/* Kleines Lupe-Icon, erscheint beim Hover */
.spx-zoom-hint {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border-radius: 4px;
    padding: 2px 3px;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spx-product-image:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 1px;
}

/* Dunkles Overlay-Backdrop */
.spx-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.spx-zoom-overlay.spx-zoom-active {
    display: flex;
}

body.spx-zoom-open {
    overflow: hidden;
}

/* Popup-Box */
.spx-zoom-popup {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    max-width: 380px;
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: spxZoomIn 0.18s ease;
}

@keyframes spxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.93);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Schließen-Button */
.spx-zoom-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    color: #111;
    border: none;
    border-radius: 0;
    width: 32px;
    height: 32px;
    font-size: 28px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 1;
    padding: 0;
    font-weight: 300;
    transition: color 0.15s;
}

.spx-zoom-close:hover {
    color: #000;
}

/* Karussell-Stage (overflow-hidden wrapper mit Pfeilen) */
.spx-zoom-stage {
    position: relative;
    overflow: hidden;
    background: #f4f4f4;
    max-height: 70vh;
}

/* Track (horizontale Slide-Zeile) */
.spx-zoom-track {
    display: flex;
    will-change: transform;
}

/* Einzelner Slide */
.spx-zoom-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bild — volle Breite, auto Höhe */
.spx-zoom-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 70vh;
    user-select: none;
    -webkit-user-drag: none;
}

/* Prev / Next Pfeile */
.spx-zoom-prev,
.spx-zoom-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 13px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.spx-zoom-prev {
    left: 8px;
}

.spx-zoom-next {
    right: 8px;
}

.spx-zoom-prev:hover,
.spx-zoom-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.spx-zoom-prev:disabled,
.spx-zoom-next:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Bild-Counter "1 / 3" */
.spx-zoom-counter {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.72rem;
    pointer-events: none;
    white-space: nowrap;
}

/* Text-Bereich */
.spx-zoom-body {
    padding: 12px 16px 14px;
}

.spx-zoom-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 5px;
    line-height: 1.3;
}

.spx-zoom-desc {
    color: #555;
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.45;
}

/* Mobile: Bottom Sheet */
@media (max-width: 540px) {
    .spx-zoom-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .spx-zoom-popup {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        animation: spxSlideUp 0.2s ease;
    }

    @keyframes spxSlideUp {
        from {
            opacity: 0;
            transform: translateY(60px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .spx-zoom-stage {
        max-height: 60vw;
    }

    .spx-zoom-img {
        max-height: 60vw;
    }

    .spx-zoom-prev {
        left: 4px;
    }

    .spx-zoom-next {
        right: 4px;
    }
}

/* === SPX Cross-Selling-Badges (Funktionsattribute: crosssellbadge1-3) ============ */

/* Anker für Badges — kein overflow:hidden, damit Badges überstehen können */
.spx-product-card-container {
    position: relative;
}

/* Badge-Reihe: halb überlappend oben-links am Card-Container */
.spx-product-badges {
    position: absolute;
    top: 0;
    right: 0;
    transform: translateY(-50%) rotate(0deg);
    transform-origin: left center;
    display: flex;
    flex-direction: row;
    gap: 4px;
    z-index: 4;
    pointer-events: none;
}

/* Pill-Badge */
.spx-product-badge {
    display: inline-block;
    padding: 3px 12px;
    font-size: 0.63rem;
    font-weight: 700;
    line-height: 1.5;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Badge 1 — Rot (z. B. "Empfehlung") */
.spx-product-badge--1 {
    background: #e74c3c;
    color: #fff;
}

/* Badge 2 — Grün (z. B. "Bestseller") */
.spx-product-badge--2 {
    background: #27ae60;
    color: #fff;
}

/* Badge 3 — Orange (z. B. "Neu") */
.spx-product-badge--3 {
    background: #f39c12;
    color: #fff;
}

/* =======================================================
   Cart: Horizontal-Slider  (.spx-cart-slider-*)
   ======================================================= */

/* Äußerer Wrapper: enthält nur noch den Viewport */
.spx-cart-slider-wrapper {
    margin-top: 0.25rem;
}

/* Sichtbarer Bereich (overflow-hidden) */
.spx-cart-slider-viewport {
    overflow: hidden;
    width: 100%;
}

/* Horizontaler Track — transform-basiertes Sliding */
.spx-cart-slider-track {
    display: flex;
    gap: 0.75rem;
    transition: transform 0.3s ease;
    will-change: transform;
    align-items: stretch;
    padding-top: 15px;
}

/* Einzelne Slide: 50% - halbe Gap → 2 Cards sichtbar */
.spx-cart-slider-slide {
    flex: 0 0 calc(50% - 0.375rem);
    min-width: 0;
    display: flex;
}

/* Gleiche Card-Höhe: Container und Card füllen die Slide-Höhe vollständig */
.spx-cart-slider-slide .spx-product-card-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.spx-cart-slider-slide .spx-product-card {
    flex: 1;
    align-items: flex-start;
}

.spx-cart-slider-slide .spx-product-info {
    flex: 1;
    justify-content: space-between;
}

/* Counter + Kaufbutton in einer Zeile (nur Warenkorb) */
.spx-cart-accessories .spx-product-quantity {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    text-align: left;
}

.spx-cart-accessories .spx-addon-counter {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

/* Slider-Pfeil-Buttons */
.spx-cart-slider-btn {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    color: #333;
}

.spx-cart-slider-btn:hover:not(:disabled) {
    background: #f2f2f2;
    border-color: #adb5bd;
}

.spx-cart-slider-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Mobile (≤768px): 1 Card sichtbar */
@media (max-width: 768px) {
    .spx-cart-slider-slide {
        flex: 0 0 100%;
    }
}

/* =====================================================
   Accordion — Gruppen als aufklappbare Panels
   ===================================================== */
#attachment-products.spx-accordion .spx-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

#attachment-products.spx-accordion .spx-accordion-item + .spx-accordion-item {
    margin-top: 0.75rem;
}

#attachment-products.spx-accordion .spx-accordion-header {
    cursor: pointer;
    padding: 0.75rem 1rem;
    margin-bottom: 0 !important;
    user-select: none;
    transition: background-color 0.15s ease;
}

#attachment-products.spx-accordion .spx-accordion-header:hover,
#attachment-products.spx-accordion .spx-accordion-header:focus-visible {
    background-color: #f5f5f5;
    outline: none;
}

#attachment-products.spx-accordion .spx-accordion-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    color: #555;
}

#attachment-products.spx-accordion .spx-accordion-item.is-open .spx-accordion-chevron {
    transform: rotate(180deg);
}

#attachment-products.spx-accordion .spx-accordion-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
    padding: 0 1rem 1rem 1rem;
}

#attachment-products.spx-accordion .spx-accordion-item.is-closed .spx-accordion-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

#attachment-products.spx-accordion .spx-accordion-item.is-open .spx-accordion-body {
    max-height: 5000px;
    opacity: 1;
}