/**
 * Inno Swatch Frontend Styles
 *
 * Handles:
 * - Swatch display (color circles, text labels)
 * - Active/hover/disabled states
 * - Quote form styling
 * - Responsive design for mobile
 */

/* ========================================
   Variations Container (Replaces Table)
   ======================================== */

.inno-variations-container {
    margin-bottom: 20px;
}

.inno-attribute-wrapper {
    margin-bottom: 25px;
}

.inno-attribute-wrapper.inno-print-color-wrapper {
    margin-bottom: 25px;
}

.inno-attribute-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

/* ========================================
   Swatch Container
   ======================================== */

.inno-swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ========================================
   Base Swatch Button Styles
   ======================================== */

.inno-swatch {
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.inno-swatch:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   Color Swatches (Circular)
   ======================================== */

.inno-swatch-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inno-swatch-color:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Text Swatches (Rectangular)
   ======================================== */

.inno-swatch-text {
    min-width: 50px;
    height: 40px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

.inno-swatch-text:hover {
    border-color: #999;
    background: #f5f5f5;
}

/* ========================================
   Image Swatches
   ======================================== */

.inno-swatch-image {
    width: 80px;
    height: auto;
    padding: 0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inno-swatch-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.inno-swatch-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.inno-swatch-image-label {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: #fff;
    color: #333;
    border-top: 1px solid #e0e0e0;
}

/* ========================================
   Selected State
   ======================================== */

.inno-swatch.selected {
    border-color: #0073aa;
    border-width: 3px;
}

.inno-swatch-color.selected {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.inno-swatch-text.selected {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.inno-swatch-image.selected {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.inno-swatch-image.selected .inno-swatch-image-label {
    background: #0073aa;
    color: #fff;
    border-top-color: #0073aa;
}

/* ========================================
   Disabled/Hidden State (for cascading filter)
   ======================================== */

.inno-swatch.hidden {
    display: none;
}

.inno-swatch:disabled,
.inno-swatch.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.inno-swatch-color.disabled,
.inno-swatch-color:disabled {
    filter: grayscale(50%);
}

.inno-swatch-color.disabled::after,
.inno-swatch-color:disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 2px;
    height: 130%;
    background: rgba(0, 0, 0, 0.4);
}

.inno-swatch-text.disabled,
.inno-swatch-text:disabled {
    background: #f0f0f0;
    color: #999;
}

.inno-swatch-text.disabled:hover,
.inno-swatch-text:disabled:hover {
    border-color: #ddd;
    background: #f0f0f0;
    transform: none;
}

/* ========================================
   Quote Form Styles
   ======================================== */

.inno-quote-fields {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.inno-quote-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.inno-quote-instructions {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.inno-quote-instructions:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.inno-quote-instructions::placeholder {
    color: #999;
}

/* Dropzone file upload - card layout like their design */
.inno-dropzone {
    padding: 15px;
    min-height: 100px;
}

.inno-dropzone .dz-preview {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 120px;
    margin: 8px;
    vertical-align: top;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.inno-dropzone .dz-preview:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.inno-dropzone .dz-preview .dz-image {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.inno-dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Details shown for images on hover, always shown for non-previewable files */
.inno-dropzone .dz-preview .dz-details {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    color: #333;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show details on hover for images */
.inno-dropzone .dz-preview.dz-image-preview:hover .dz-details {
    opacity: 1;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}

/* Always show details for non-image files (PDFs, etc) */
.inno-dropzone .dz-preview.dz-file-preview .dz-details {
    opacity: 1;
}

.inno-dropzone .dz-preview .dz-size {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.inno-dropzone .dz-preview .dz-filename {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

/* Remove button - always visible X button without text */
.inno-dropzone .dz-preview .dz-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: #dc3545;
    color: transparent;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 0;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    opacity: 1;
    z-index: 10;
}

.inno-dropzone .dz-preview .dz-remove:before {
    content: "×";
    color: #fff;
    font-size: 18px;
    display: block;
}

.inno-dropzone .dz-preview .dz-remove:hover {
    background: #c82333;
}

/* Success/error marks */
.inno-dropzone .dz-preview .dz-success-mark,
.inno-dropzone .dz-preview .dz-error-mark {
    display: none;
}

/* Progress bar */
.inno-dropzone .dz-preview .dz-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.inno-dropzone .dz-preview .dz-progress .dz-upload {
    display: block;
    height: 100%;
    background: #0073aa;
}

/* ========================================
   Responsive Mobile Styles
   ======================================== */

@media (max-width: 768px) {
    .inno-swatch-container {
        gap: 8px;
    }

    .inno-swatch-color {
        width: 36px;
        height: 36px;
    }

    .inno-swatch-text {
        min-width: 45px;
        height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .inno-swatch-image {
        width: 70px;
    }

    .inno-swatch-image img {
        height: 70px;
    }

    .inno-swatch-image-label {
        font-size: 11px;
        padding: 5px 6px;
    }
}

@media (max-width: 480px) {
    .inno-swatch-container {
        gap: 6px;
    }

    .inno-swatch-color {
        width: 32px;
        height: 32px;
    }

    .inno-swatch-text {
        min-width: 40px;
        height: 32px;
        padding: 5px 10px;
        font-size: 12px;
    }

    .inno-swatch-image {
        width: 60px;
    }

    .inno-swatch-image img {
        height: 60px;
    }

    .inno-swatch-image-label {
        font-size: 10px;
        padding: 4px 5px;
    }
}
