/**
 * DO Linked Variations - Frontend CSS
 * WooCommerce swatch buton stilleri
 */

/* ===== Wrapper ===== */
.dolv-swatches-wrapper {
    margin: 0 0 20px;
    padding: 0;
}

/* ===== Swatch Grubu ===== */
.dolv-swatch-group {
    margin-bottom: 16px;
}

.dolv-swatch-group:last-child {
    margin-bottom: 0;
}

/* ===== Grup Label ===== */
.dolv-swatch-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}

/* ===== Swatch Options Container ===== */
.dolv-swatch-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 100vh !important;
}

/* ===== Swatch Butonu ===== */
.dolv-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 40px;
    padding: 6px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
    box-sizing: border-box;
}

.dolv-swatch:hover {
    border-color: #333;
    color: #333;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dolv-swatch:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

/* ===== Aktif Swatch ===== */
.dolv-swatch.active {
    border-color: #333;
    background: #333;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.dolv-swatch.active:hover {
    background: #444;
    border-color: #444;
    color: #fff;
}

/* ===== Unavailable (URL tanımlı değil) ===== */
.dolv-swatch.unavailable {
    border-color: #e74c3c;
    background: #fff5f5;
    color: #e74c3c;
    position: relative;
    animation: dolv-shake 0.3s ease;
}

@keyframes dolv-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-3px);
    }
}

/* ===== Disabled Swatch ===== */
.dolv-swatch.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #eee;
    background: #f9f9f9;
    color: #aaa;
}

.dolv-swatch.disabled:hover {
    border-color: #eee;
    box-shadow: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .dolv-swatch {
        min-width: 40px;
        height: 36px;
        padding: 5px 12px;
        font-size: 12px;
    }

    .dolv-swatch-options {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .dolv-swatch {
        min-width: 36px;
        height: 34px;
        padding: 4px 10px;
        font-size: 11px;
    }

    .dolv-swatch-options {
        gap: 4px;
    }

    .dolv-swatch-label {
        font-size: 13px;
    }
}

/* ===== Color Swatch Circle ===== */
.dolv-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    /* Metin ile arasındaki boşluk */
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Hafif çerçeve, beyaz renkler için */
    flex-shrink: 0;
    /* Daralmasını engelle */
}

/* Ensure flex alignment for buttons with colors */
.dolv-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0;
    /* Gap yerine margin-right kullandık span içinde */
}