/* SellX NameBased Variants Plugin Styles - Bootstrap Column Layout */

.sellx-variant-selector-container {
    margin-top: 2rem;
}

.variant-title {
    font-size: 16px;
    color: #2c3e50;
}

/* Individual Variant Swatch */
.variant-swatch {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.variant-swatch:hover:not(.variant-disabled) {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.variant-swatch:focus {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.variant-swatch.variant-current {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.04);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.variant-swatch.variant-disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(1);
}

.variant-swatch.variant-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Image Container */
.variant-image-container {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 6px;
    background: #f8f9fa;
}

.variant-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variant-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Placeholder for missing images */
.variant-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 2rem;
}

/* Variant Info */
.variant-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variant-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #2c3e50;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.variant-pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.variant-price {
    font-weight: 600;
    font-size: 1rem;
    color: #000;
}

.variant-unit-price {
    font-size: 0.75rem;
    color: #6c757d;
}

.variant-baseprice {
    font-size: 0.65rem !important;
    color: #000 !important;
    font-weight: 400 !important;
}

/* Loading state */
.variant-swatch.loading {
    opacity: 0.6;
    pointer-events: none;
}

.variant-tooltip-display {
    transition: opacity 0.2s ease;
}

/* Focus states for accessibility */
.variant-swatch:focus,
.variant-swatch:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .variant-swatch {
        border-width: 3px;
    }
    
    .variant-image-container {
        border: 1px solid var(--bs-border-color, #e3e7e8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .variant-swatch,
    .variant-image img,
    .variant-swatch::before,
    .variant-swatch.loading {
        transition: none;
        animation: none;
        transform: none !important;
    }
}

/* Additional modern touches */
.variant-swatch {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.variant-swatch:active:not(.variant-disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 12px rgba(13, 110, 253, 0.25);
}

/* Hover animation for variant info */
.variant-swatch:hover:not(.variant-disabled) .variant-price {
    color: var(--bs-success, #198754);
}

/* Tooltip display next to title */
.variant-tooltip-display {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Special styling for very long variant names */
.variant-name {
    word-break: break-word;
    hyphens: auto;
}

/* Tooltip for truncated variant names */
.variant-swatch[data-title] {
    position: relative;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}