/* Custom Swatches Styling - Match React Native App UI */

/* Size Buttons - Each in separate card */
.wd-text-style .wd-swatch {
    display: inline-block;
    margin: 0 8px 8px 0;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.wd-text-style .wd-swatch:hover {
    border-color: #333;
    background: #f9f9f9;
}

.wd-text-style .wd-swatch.wd-active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Color Image Thumbnails - Small like React Native */
.wd-images-style .wd-swatch {
    display: inline-block;
    margin: 0 8px 8px 0;
    width: 70px;
    height: 70px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wd-images-style .wd-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wd-images-style .wd-swatch:hover {
    border-color: #999;
    transform: scale(1.05);
}

.wd-images-style .wd-swatch.wd-active {
    border-color: #000;
    border-width: 3px;
}

/* Swatch Wrapper Layout */
.wd-swatch-wrapper {
    margin-bottom: 20px;
}

.wd-swatch-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tooltip on hover */
.wd-swatch .wd-tooltip-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.wd-swatch:hover .wd-tooltip-label {
    opacity: 1;
}

/* RTL Support for Arabic */
[dir="rtl"] .wd-swatch {
    margin: 0 0 8px 8px;
}

/* Mobile Responsive - Optimized for better space usage */
@media (max-width: 768px) {
    /* Color Images - 5 per row = 2 rows for 10 colors */
    .wd-images-style .wd-swatch {
        width: calc(20% - 8px) !important;  /* 5 images per row */
        height: auto !important;
        padding-bottom: 20% !important;  /* Square aspect ratio */
        position: relative !important;
        margin: 4px !important;
        display: inline-block !important;
        vertical-align: top !important;
    }
    
    .wd-images-style .wd-swatch img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .wd-images-style .wd-swatch-inner {
        display: block !important;
        gap: 0 !important;
        margin: 0 !important;
        text-align: center !important;
    }
    
    /* Size Buttons - Comfortable touch targets */
    .wd-text-style .wd-swatch {
        padding: 12px 20px !important;
        min-width: 70px !important;
        font-size: 14px !important;
        margin: 0 6px 10px 6px !important;
    }
    
    .wd-text-style .wd-swatch-inner {
        justify-content: flex-start !important;  /* Keep original right alignment for RTL */
        gap: 4px !important;
        display: flex !important;
    }
}

/* Extra small screens - 4 images per row */
@media (max-width: 360px) {
    .wd-images-style .wd-swatch {
        width: calc(25% - 8px) !important;  /* 4 images per row */
        padding-bottom: 25% !important;
    }
}
