/* 1. Reset the wrapper container to fix alignment & completely kill the theme's chevron */
.variations td.value .woocommerce-select {
    display: block !important;
    background: none !important; /* Removes background arrow images if any */
    border: none !important;     /* Removes wrapper borders */
    padding: 0 !important;       /* Resets theme padding */
    margin: 0 !important;
    width: 100% !important;
}

/* Forcefully hide any CSS pseudo-element arrows/chevrons attached to the wrapper */
.variations td.value .woocommerce-select::before,
.variations td.value .woocommerce-select::after {
    display: none !important;
    content: none !important;
}

/* 2. Hide ONLY the actual native dropdown menu */
.variations td.value select {
    display: none !important;
}

/* 3. Align table rows so the Label ("Inhalt") and Buttons sit nicely together */
.variations tr {
    display: flex;
    flex-direction: column; /* Stacks label on top of buttons for mobile/clean modern look */
    gap: 8px;
    margin-bottom: 20px;
}

/* If you prefer the Label and Buttons side-by-side on desktop, uncomment this block:
@media (min-width: 768px) {
    .variations tr {
        flex-direction: row;
        align-items: center;
    }
    .variations th.label {
        min-width: 100px; 
    }
}
*/

/* 4. Style the new button container layout */
.custom-swatch-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 5. Style individual variation buttons */
.custom-swatch-buttons .swatch-btn {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #dcdcdc;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: none;
}

/* 6. Hover effect */
.custom-swatch-buttons .swatch-btn:hover {
    border-color: #888888;
    background-color: #fafafa;
}

/* 7. Style for the selected/active button */
.custom-swatch-buttons .swatch-btn.active {
    background-color: #222222 !important; /* Selected background color */
    color: #ffffff !important;            /* Selected text color */
    border-color: #222222 !important;
}

@media (max-width: 1024px) {
    /* 1. Ensure the parent container can accommodate the reset link nicely */
    .variations td.value {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* 2. Reposition the "X" reset link closer to the buttons */
    .woocommerce .cart .reset_variations {
        position: static !important; /* Pulls it out of absolute positioning */
        display: inline-block !important; /* Forces visibility rules when active */
        margin-top: 5px;
        text-align: left;
        width: auto; /* Allow text/icon to dictate width instead of forced 2rem */
        font-size: 13px;
        color: #ff0000; /* Optional: Make the X stand out slightly if needed */
    }
}