/* Loading para imagem */
.gloss-image-loading {
    width: 150px;
    height: 150px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: #999;
    font-size: 14px;
    border: 1px dashed #ddd;
}

/* Tooltip para imagem */
.gloss-image-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gloss-image-preview:hover .gloss-image-tooltip {
    opacity: 1;
}

/* Image Select Styles - ESTILOS PRINCIPAIS ADICIONADOS */
.gloss-image-select-container {
    margin-bottom: 10px;
}

.gloss-image-select-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 5px;
}

.gloss-image-option {
    border: 3px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    text-align: center;
    position: relative;
}

.gloss-image-option:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gloss-image-option.selected {
    border-color: #007cba;
    background: #f0f8ff;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.gloss-image-option-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gloss-image-option img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: transform 0.3s ease;
}

.gloss-image-option:hover img {
    transform: scale(1.05);
}

.gloss-image-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 5px;
    line-height: 1.2;
}

.gloss-image-option-label {
    text-align: center;
}

.gloss-image-option-label span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.gloss-image-option-label small {
    font-size: 11px;
    color: #007cba;
    font-weight: 500;
}

.bottle-price-info {
    margin-top: 5px;
}

.bottle-total-price {
    font-size: 11px;
    color: #46b450;
    font-weight: bold;
    display: block;
    margin-top: 2px;
}

.bottle-price-breakdown {
    font-size: 10px;
    color: #666;
    display: block;
    margin-top: 1px;
}

/* Lightbox Styles */
.gloss-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gloss-lightbox.active {
    display: flex;
    opacity: 1;
}

.gloss-lightbox-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.gloss-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.gloss-lightbox-close:hover {
    background: #dc3232;
    transform: scale(1.1);
}

.gloss-lightbox-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

.gloss-lightbox-info {
    padding: 20px;
    background: white;
}

.gloss-lightbox-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.gloss-lightbox-description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.gloss-lightbox-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.gloss-lightbox-select {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.gloss-lightbox-select:hover {
    background: #005a87;
}

.gloss-lightbox-cancel {
    background: #ccc;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.gloss-lightbox-cancel:hover {
    background: #999;
}

/* Melhorias para mobile */
@media (max-width: 768px) {
    .gloss-image-select-options {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .gloss-image-option {
        padding: 8px;
    }
    
    .gloss-image-option img,
    .gloss-image-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .gloss-image-option-label span {
        font-size: 12px;
    }
    
    .gloss-image-option-label small {
        font-size: 10px;
    }
    
    .gloss-lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .gloss-lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .gloss-lightbox-image {
        max-width: 100%;
        max-height: 50vh;
    }
    
    .gloss-lightbox-info {
        padding: 15px;
    }
    
    .gloss-lightbox-title {
        font-size: 16px;
    }
    
    .gloss-lightbox-description {
        font-size: 13px;
    }
    
    .gloss-lightbox-actions {
        flex-direction: column;
    }
    
    .gloss-lightbox-select,
    .gloss-lightbox-cancel {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Para telas muito pequenas */
@media (max-width: 480px) {
    .gloss-image-select-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gloss-image-option {
        padding: 6px;
    }
    
    .gloss-lightbox-content {
        max-width: 98%;
    }
    
    .gloss-lightbox-image {
        max-height: 40vh;
    }
    
    .gloss-lightbox-close {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

/* Prevenir zoom indesejado em iOS */
@supports (-webkit-touch-callout: none) {
    .gloss-config-field,
    .gloss-quantity {
        font-size: 16px !important;
    }
    
    .gloss-image-preview {
        -webkit-touch-callout: none;
    }
}

/* Melhorar feedback visual no mobile */
.gloss-image-option:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Garantir que o lightbox seja clicável */
.gloss-lightbox {
    -webkit-overflow-scrolling: touch;
}

.gloss-lightbox-content {
    pointer-events: auto;
}