/* Déclinaisons listing — Sportaixtrem (popover body portal) */

.tvproduct-wrapper.sa-listing-combinations--active {
    overflow: visible;
    position: relative;
    z-index: 120;
}

.tvproduct-wrapper.sa-listing-combinations--active .tvproduct-image {
    overflow: visible;
}

.sa-listing-combinations-popover {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow:
        0 14px 32px rgba(15, 23, 42, 0.15),
        0 2px 6px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(15, 23, 42, 0.03);
    box-sizing: border-box;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform: translateY(6px) scale(0.98);
    transform-origin: bottom center;
    transition:
        opacity 0.16s ease,
        transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
    z-index: 10050;
}

.sa-listing-combinations-popover::before {
    background: #ffffff;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    bottom: -6px;
    content: '';
    height: 10px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
}

.sa-listing-combinations-popover--above::before {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-left: none;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-top: none;
    bottom: -6px;
    top: auto;
}

.sa-listing-combinations-popover--below {
    transform: translateY(-6px) scale(0.98);
    transform-origin: top center;
}

.sa-listing-combinations-popover--below::before {
    border-bottom: none;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    border-right: none;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    bottom: auto;
    top: -6px;
}

.sa-listing-combinations-popover--visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.sa-listing-combinations-popover__list {
    align-content: flex-start;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    max-width: min(320px, calc(100vw - 16px));
    padding: 9px 9px 10px;
}

.sa-listing-combinations-popover--no-stock .sa-listing-combinations__tile {
    height: 30px;
    min-width: 40px;
    padding: 0 10px;
}

.sa-listing-combinations-popover--no-stock .sa-listing-combinations__skeleton {
    height: 30px;
    width: 40px;
}

.sa-listing-combinations__tile {
    align-items: center;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    box-sizing: border-box;
    color: #0f172a;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    height: 42px;
    justify-content: center;
    line-height: 1;
    min-width: 44px;
    padding: 4px 8px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    width: auto;
}

.sa-listing-combinations__tile:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.sa-listing-combinations__size {
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.sa-listing-combinations__qty {
    color: #64748b;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sa-listing-combinations__tile--low {
    background: #fef2f2;
    border-color: #fecaca;
}

.sa-listing-combinations__tile--low .sa-listing-combinations__qty {
    color: #dc2626;
    font-weight: 700;
}

.sa-listing-combinations__tile--low:hover {
    background: #0f172a;
    border-color: #0f172a;
}

.sa-listing-combinations__tile--low:hover .sa-listing-combinations__qty,
.sa-listing-combinations__tile:hover .sa-listing-combinations__qty {
    color: rgba(255, 255, 255, 0.85);
}

.sa-listing-combinations__skeleton {
    animation: sa-listing-combinations-shimmer 1.1s ease-in-out infinite;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.1) 50%, rgba(15, 23, 42, 0.05) 100%);
    background-size: 200% 100%;
    border-radius: 8px;
    box-sizing: border-box;
    flex: 0 0 auto;
    height: 42px;
    width: 44px;
}

@keyframes sa-listing-combinations-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 767px) {
    .sa-listing-combinations-popover__list {
        gap: 4px;
        padding: 8px;
    }

    .sa-listing-combinations-popover--no-stock .sa-listing-combinations__tile,
    .sa-listing-combinations-popover--no-stock .sa-listing-combinations__skeleton {
        height: 28px;
    }

    .sa-listing-combinations__tile {
        height: 38px;
        min-width: 40px;
        padding: 4px 7px;
    }

    .sa-listing-combinations__skeleton {
        height: 38px;
        width: 40px;
    }

    .sa-listing-combinations__size {
        font-size: 11px;
    }

    .sa-listing-combinations__qty {
        font-size: 9.5px;
    }
}

@media (hover: none) {
    .sa-listing-combinations-popover {
        display: none;
    }
}
