/* Badge overlay - posicionamiento en tarjetas de producto */
.badge-overlay {
    position: absolute;
    z-index: 2;
    max-width: 4.7em;
    max-height: 6em;
    pointer-events: none;
}

.badge-top-left {
    top: 2em;
    left: 1em;
}

.badge-top-right {
    top: 2em;
    right: 1em;
}

.badge-bottom-left {
    bottom: 3em;
    left: 1em;
}

.badge-bottom-right {
    bottom: 4em;
    right: 1em;
}

/* Badge en vista detalle de producto (imagen más grande) */
.single_producto_unit .badge-overlay {
    max-width: 7em;
    max-height: 7em;
}

.single_producto_unit .badge-top-left {
    top: 1em;
    left: 1em;
}

.single_producto_unit .badge-top-right {
    top: 1em;
    right: 1em;
}

.single_producto_unit .badge-bottom-left {
    bottom: 1em;
    left: 1em;
}

.single_producto_unit .badge-bottom-right {
    bottom: 1em;
    right: 1em;
}

/* Responsive */
@media only screen and (max-width: 768px) {
    .badge-overlay {
        max-width: 55px;
        max-height: 55px;
    }
    .single_producto_unit .badge-overlay {
        max-width: 5.5em;
        max-height: 7em;
    }

    .badge-top-left {
        top: 0em;
        left: 0em;
    }

    .badge-top-right {
        top: 3em;
        right: 0.2em;
    }

    .badge-bottom-left {
        bottom: 3.5em;
        left: 0em;
    }

    .badge-bottom-right {
        bottom: 3.5em;
        right: 0em;
    }
    
}

/* === Badge Position Picker (formulario de asignación) === */
.badge-position-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.badge-position-picker label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: border-color 0.2s;
}

.badge-position-picker label:hover {
    border-color: #999;
}

.badge-position-picker input[type="radio"]:checked + span {
    background-color: #4a90d9;
}

.badge-position-picker input[type="radio"]:checked ~ span.badge-pos-label {
    font-weight: bold;
}

.badge-pos-visual {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 3px;
    position: relative;
    background: #f5f5f5;
}

.badge-pos-visual::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 2px;
}

.badge-pos-tl::after { top: 2px; left: 2px; }
.badge-pos-tr::after { top: 2px; right: 2px; }
.badge-pos-bl::after { bottom: 2px; left: 2px; }
.badge-pos-br::after { bottom: 2px; right: 2px; }

/* === Badge preview en formularios === */
.badge-preview-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
    margin: 8px 0;
}

.badge-preview-box img {
    max-width: 70px;
    max-height: 70px;
}

/* === Tabla de asignaciones === */
.badge-asignaciones-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.badge-asignaciones-table th,
.badge-asignaciones-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.badge-asignaciones-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.badge-asignaciones-table .badge-pos-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 0.85em;
}

.badge-asignaciones-table .badge-tipo-producto {
    color: #1e8e3e;
}

.badge-asignaciones-table .badge-tipo-grupo {
    color: #e8710a;
}
