/**
 * Estilos de administración - Mercadito Circular
 *
 * @package MercaditoCircular
 * @since 1.0.0
 */

/* ==========================================================================
   Metabox de fotografías
   ========================================================================== */
.mc-fotos-wrapper {
    padding: 8px 0;
}

.mc-fotos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (min-width: 1200px) {
    .mc-fotos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mc-foto-item {
    text-align: center;
}

.mc-foto-preview {
    width: 100%;
    height: 120px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mc-foto-placeholder {
    color: #999;
    font-size: 12px;
}

.mc-foto-item .button {
    margin: 2px;
    font-size: 12px;
    min-height: 28px;
    line-height: 2.2;
}

/* ==========================================================================
   Formulario de producto (vendedor)
   ========================================================================== */
.mc-form-fotos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .mc-form-fotos {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mc-form-foto-item {
    text-align: center;
}

.mc-form-foto-preview {
    width: 100%;
    height: 120px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-form-foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mc-form-foto-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
}

.mc-form-foto-item .button {
    margin: 2px;
    font-size: 12px;
}

/* ==========================================================================
   Categorías admin
   ========================================================================== */
#mc-categorias-admin {
    margin-top: 20px;
}

.mc-categorias-form {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 16px 24px;
    margin-bottom: 24px;
}

.mc-categorias-form h2 {
    margin-top: 0;
    font-size: 14px;
    font-weight: 600;
}

.mc-categorias-form .form-table {
    margin-top: 0;
}

.mc-categorias-form .form-table th {
    width: 160px;
}

.mc-categorias-form .submit {
    margin: 8px 0 0;
    padding: 0;
}

#mc-categorias-admin .wp-list-table {
    margin-top: 8px;
}

#mc-categorias-admin .wp-list-table code {
    font-size: 12px;
}

#mc-categorias-admin .description {
    color: #646970;
    font-size: 12px;
}

.mc-acciones .button-small {
    margin: 0 2px;
}

/* ==========================================================================
   Tabla de administración
   ========================================================================== */
.mc-acciones {
    white-space: nowrap;
}

.mc-acciones .button {
    margin: 0 2px;
}

/* Asegurar que el checkbox de publicación funcione en frontend */
.mc-product-form input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: auto !important;
    height: auto !important;
}

/* Columna de foto en el listado */
.column-mc_foto {
    width: 60px;
}

/* ==========================================================================
   Dashboard widget
   ========================================================================== */
#mc_dashboard_widget .inside {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Mensajes
   ========================================================================== */
.mc-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 16px 0;
}

.mc-message-success {
    background: #edfaef;
    border: 1px solid #68de7c;
    color: #1b5e20;
}

.mc-message-error {
    background: #fbeaea;
    border: 1px solid #f1adad;
    color: #b71c1c;
}

/* ==========================================================================
   Filtros admin
   ========================================================================== */
select[name="mc_activo"],
select[name="mc_departamento"] {
    float: none;
    margin: 0 4px 0 0;
}
