/* =============================================================================
   LALALO VariantLinks — lalalo-variant-links.css
   Amazon-style swatch tiles for product variant selection on simple products.
   ============================================================================= */

/* Container */
.lalalo-variant-links {
    margin: 10px 0 14px;
    max-width: 100%;
}

/* "Varianten" heading */
.lalalo-variant-links__heading {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #444;
    margin: 0 0 8px;
    padding: 0;
}

/* Scrollable tile row */
.lalalo-variant-links__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;       /* Firefox: hide scrollbar */
    padding-bottom: 3px;         /* Space for focus outline */
    align-items: flex-start;
}

.lalalo-variant-links__track::-webkit-scrollbar {
    display: none;               /* Chrome/Safari: hide scrollbar */
}

/* Individual tile wrapper */
.lalalo-variant-links__tile {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Shared inner styles — applies to both <a> and <span> */
.lalalo-variant-links__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 72px;
    min-height: 76px;
    padding: 4px;
    border: 2px solid #c8c8c8;
    border-radius: 5px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.12s ease;
    cursor: pointer;
}

/* Hover/focus for link tiles */
a.lalalo-variant-links__inner:hover {
    border-color: #555;
    text-decoration: none;
}

a.lalalo-variant-links__inner:focus {
    outline: none;
    border-color: #555;
}

a.lalalo-variant-links__inner:focus-visible {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
    border-color: #005fcc;
}

/* Active (current product) tile */
.lalalo-variant-links__tile--active .lalalo-variant-links__inner {
    border-color: #111;
    border-width: 2px;
    background: #f6f6f6;
    cursor: default;
}

/* Product thumbnail */
.lalalo-variant-links__img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    flex-shrink: 0;
}

/* Placeholder when product has no image */
.lalalo-variant-links__img--placeholder {
    width: 60px;
    height: 60px;
    background: #ebebeb;
    border-radius: 3px;
    display: block;
    flex-shrink: 0;
}

/* Short variant label ("Blau", "Rot, XL", etc.) */
.lalalo-variant-links__label {
    display: block;
    font-size: 0.75rem;
    line-height: 1.25;
    text-align: center;
    margin-top: 4px;
    color: #333;
    max-width: 60px;
    word-break: break-word;
    hyphens: auto;
    overflow: hidden;
    /* Limit to 2 lines to keep tiles compact */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Bold label on active tile */
.lalalo-variant-links__tile--active .lalalo-variant-links__label {
    font-weight: 700;
    color: #111;
}

/* =============================================================================
   Scroll navigation — wrapper, fade gradients, arrow buttons
   ============================================================================= */

.lalalo-variant-links__scroll-wrapper {
    position: relative;
}

/* Fade gradients (left + right) — reveal when JS adds vl-can-* classes */
.lalalo-variant-links__scroll-wrapper::before,
.lalalo-variant-links__scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 3px; /* match track padding-bottom */
    width: 28px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1;
}

.lalalo-variant-links__scroll-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.95) 30%, rgba(255,255,255,0));
}

.lalalo-variant-links__scroll-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.95) 30%, rgba(255,255,255,0));
}

.lalalo-variant-links__scroll-wrapper.vl-can-left::before  { opacity: 1; }
.lalalo-variant-links__scroll-wrapper.vl-can-right::after  { opacity: 1; }

/* Arrow buttons — JS sets display:flex when needed, hidden on touch devices */
.lalalo-variant-links__scroll-btn {
    display: none; /* shown by JS (flex) when scrollable in that direction */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 22px;
    height: 22px;
    padding: 0;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    color: #444;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    transition: border-color 0.12s ease, color 0.12s ease;
}

.lalalo-variant-links__scroll-btn:hover {
    border-color: #555;
    color: #111;
}

.lalalo-variant-links__scroll-btn--left  { left:  -11px; }
.lalalo-variant-links__scroll-btn--right { right: -11px; }

/* Touch devices: buttons unnecessary (native swipe works), fade still active */
@media (pointer: coarse) {
    .lalalo-variant-links__scroll-btn { display: none !important; }
}
