/* =============================================
   OZ Racing – Variation Swatches
   Replaces WooCommerce dropdown selects with
   clickable color/size tiles
   ============================================= */

.oz-swatch-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

/* --- Farb-Kacheln --- */
.oz-swatch-wrapper .oz-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
}

.oz-swatch-wrapper .oz-swatch:hover {
    border-color: #999;
    transform: scale(1.1);
}

.oz-swatch-wrapper .oz-swatch.active {
    border-color: #000;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

.oz-swatch-wrapper .oz-swatch.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tooltip mit Farbname */
.oz-swatch-wrapper .oz-swatch[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.oz-swatch-wrapper .oz-swatch[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 10;
}

/* Fallback: Farbkachel ohne Bild (Text-Kreis) */
.oz-swatch-wrapper .oz-swatch.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #333;
    background: #f0f0f0;
    line-height: 1.1;
    text-align: center;
    padding: 4px;
    word-break: break-all;
}

/* --- Größen-Kacheln --- */
.oz-swatch-wrapper .oz-size-tile {
    min-width: 52px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #ddd;
    cursor: pointer;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 0 12px;
    transition: all 0.2s;
    user-select: none;
}

.oz-swatch-wrapper .oz-size-tile:hover {
    border-color: #999;
    background: #f5f5f5;
}

.oz-swatch-wrapper .oz-size-tile.active {
    border-color: #000;
    background: #000;
    color: #fff;
}

.oz-swatch-wrapper .oz-size-tile.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: line-through;
}

/* Hide original WooCommerce selects when swatches active */
.variations .oz-swatch-wrapper+select,
.variations select.oz-hidden {
    display: none !important;
}

/* Label Styling */
.variations td.label label {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}