/* ============================================
   WooCommerce Frontend Product Capture - Minimalista
   ============================================ */

:root {
    /* Paleta de colores minimalista */
    --wcfc-text-main: #111827;
    --wcfc-text-muted: #6b7280;
    --wcfc-bg-main: #ffffff;
    --wcfc-bg-subtle: #f9fafb;
    --wcfc-border-color: #e5e7eb;
    
    /* Colores de acento para botones (Outline) */
    --wcfc-accent: #3b82f6; /* Azul limpio */
    --wcfc-success: #10b981; /* Verde fresco */
    --wcfc-danger: #ef4444; /* Rojo suave */
    --wcfc-gray: #4b5563; /* Gris neutro */

    /* Estructura */
    --wcfc-radius: 8px;
    --wcfc-radius-lg: 16px;
    --wcfc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Contenedores principales */
.wcfc-form-container,
.wcfc-products-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--wcfc-bg-main);
    border-radius: var(--wcfc-radius-lg);
    border: 1px solid var(--wcfc-border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--wcfc-text-main);
}

@media (min-width: 768px) {
    .wcfc-form-container,
    .wcfc-products-container {
        padding: 2.5rem;
    }
}

.wcfc-products-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wcfc-text-main);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--wcfc-border-color);
}

/* 2. Formularios e Inputs */
.wcfc-form-group {
    margin-bottom: 1.5rem;
}

.wcfc-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--wcfc-text-main);
}

.wcfc-form-group input[type="text"],
.wcfc-form-group input[type="number"],
.wcfc-form-group textarea,
.wcfc-product-edit-form input[type="text"],
.wcfc-product-edit-form input[type="number"],
.wcfc-product-edit-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--wcfc-bg-subtle);
    border: 1px solid var(--wcfc-border-color);
    border-radius: var(--wcfc-radius);
    font-size: 1rem;
    color: var(--wcfc-text-main);
    transition: var(--wcfc-transition);
    box-sizing: border-box;
}

.wcfc-form-group input[type="text"]:focus,
.wcfc-form-group input[type="number"]:focus,
.wcfc-form-group textarea:focus,
.wcfc-product-edit-form input:focus,
.wcfc-product-edit-form textarea:focus {
    background-color: var(--wcfc-bg-main);
    border-color: var(--wcfc-accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.wcfc-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* 3. Área de subida de imágenes */
.wcfc-upload-area,
.wcfc-gallery-area {
    border: 1.5px dashed var(--wcfc-border-color);
    border-radius: var(--wcfc-radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--wcfc-bg-subtle);
    transition: var(--wcfc-transition);
}

.wcfc-gallery-area {
    padding: 1.5rem;
    margin-top: 1rem;
}

.wcfc-upload-area:hover,
.wcfc-gallery-area:hover,
.wcfc-upload-area.highlight {
    border-color: var(--wcfc-accent);
    background-color: rgba(59, 130, 246, 0.02);
}

.wcfc-upload-prompt,
.wcfc-gallery-prompt {
    color: var(--wcfc-text-muted);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .wcfc-upload-prompt {
        flex-direction: row;
        justify-content: center;
    }
}

/* Previsualización de imágenes */
.wcfc-image-preview {
    margin-top: 1.5rem;
    position: relative;
    display: inline-block;
}

.wcfc-image-preview img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    border-radius: var(--wcfc-radius);
    border: 1px solid var(--wcfc-border-color);
}

.wcfc-gallery-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.wcfc-gallery-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--wcfc-radius);
    overflow: hidden;
    border: 1px solid var(--wcfc-border-color);
}

.wcfc-gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botones de eliminar imagen (Minimalistas) */
.wcfc-remove-image,
.wcfc-gallery-preview-item .wcfc-remove-gallery-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--wcfc-bg-main);
    color: var(--wcfc-danger);
    border: 1px solid var(--wcfc-border-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: var(--wcfc-transition);
}

.wcfc-remove-image:hover,
.wcfc-gallery-preview-item .wcfc-remove-gallery-image:hover {
    background: var(--wcfc-danger);
    color: var(--wcfc-bg-main);
    border-color: var(--wcfc-danger);
}

/* 4. Sistema de Botones Outline Generales */
.wcfc-edit-btn {
    width: 49%;
    padding: 12px;
    border-radius: 12px 12px 12px 12px;
    background: #007cba00;
    font-size: 14px;
    border: solid;
    border-color: #1b70e2;
	  color: #1b70e2;
    cursor: pointer;
    transition: background 0.2s;
    border-width: 2px;
}

.wcfc-delete-btn {
    width: 49%;
    padding: 12px;
    border-radius: 12px 12px 12px 12px;
    background: #007cba00;
    font-size: 14px;
    border: solid;
    border-color: red;
    color: red;
    cursor: pointer;
    transition: background 0.2s;
    border-width: 2px;
}

.wcfc-submit-btn {
    width: 48%;
    padding: 12px;
    border-radius: 12px 12px 12px 12px;
    background: #007cba00;
    font-size: 14px;
    border: solid;
    border-color: #6b6b6b;
    color: #6b6b6b;
    cursor: pointer;
    transition: background 0.2s;
    border-width: 2px;
}

.wcfc-upload-btn {
    width: 48%;
    padding: 12px;
    border-radius: 12px 12px 12px 12px;
    background: #007cba00;
    font-size: 14px;
    border: solid;
    border-color: #6b6b6b;
    color: #6b6b6b;
    cursor: pointer;
    transition: background 0.2s;
    border-width: 2px;
}

.wcfc-cancel-edit {
    width: 48%;
    padding: 12px;
    border-radius: 12px 12px 12px 12px;
    background: #007cba00;
    font-size: 14px;
    border: solid;
    border-color: #6b6b6b;
    color: #6b6b6b;
    cursor: pointer;
    transition: background 0.2s;
    border-width: 2px;
}

.wcfc-print-label-btn {
    width: 48%;
    padding: 12px;
    border-radius: 12px 12px 12px 12px;
    background: #007cba00;
    font-size: 14px;
    border: solid;
    border-color: #1b70e2;
    color: #1b70e2;
    cursor: pointer;
    transition: background 0.2s;
    border-width: 2px;
}


/* Botón de Enviar / Éxito */
.wcfc-submit-btn {
    color: var(--wcfc-success);
    border: 1.5px solid var(--wcfc-success);
    width: 100%;
}
.wcfc-submit-btn:hover {
    background: var(--wcfc-success);
    color: var(--wcfc-bg-main);
}

/* Botones de Actualizar / Subida */
.wcfc-update-btn,
.wcfc-upload-btn {
    color: var(--wcfc-accent);
    border: 1.5px solid var(--wcfc-accent);
}
.wcfc-update-btn:hover,
.wcfc-upload-btn:hover {
    background: var(--wcfc-accent);
    color: var(--wcfc-bg-main);
}



@media (min-width: 640px) {
    .wcfc-submit-btn {
        width: auto;
    }
}

/* 5. Grid de Productos */
.wcfc-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .wcfc-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* Tarjeta de Producto Minimalista */
.wcfc-product-card {
    background: var(--wcfc-bg-main);
    border-radius: var(--wcfc-radius);
    border: 1px solid var(--wcfc-border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--wcfc-transition);
}

.wcfc-product-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    transform: translateY(-2px);
}

.wcfc-product-image {
    height: 220px;
    overflow: hidden;
    background: var(--wcfc-bg-subtle);
    border-bottom: 1px solid var(--wcfc-border-color);
}

.wcfc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wcfc-product-card:hover .wcfc-product-image img {
    transform: scale(1.03);
}

.wcfc-product-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wcfc-product-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: var(--wcfc-text-main);
    font-weight: 600;
}

.wcfc-product-price {
    font-weight: 600;
    color: var(--wcfc-text-main);
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
}

.wcfc-product-sku,
.wcfc-product-date {
    color: var(--wcfc-text-muted);
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

.wcfc-product-short-desc {
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--wcfc-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wcfc-product-qr {
    margin-top: auto;
    padding-top: 1rem;
    text-align: center;
}

.wcfc-product-qr img {
    max-width: 80px;
    border-radius: var(--wcfc-radius);
    mix-blend-mode: multiply;
}

/* ============================================
   Acciones de la Tarjeta (Editar y Eliminar)
   ============================================ */

.wcfc-product-card-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--wcfc-border-color);
    background: var(--wcfc-bg-subtle);
    margin-top: auto;
}

.wcfc-product-card-actions .wcfc-edit-btn,
.wcfc-product-card-actions .wcfc-delete-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: var(--wcfc-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    background: transparent;
    transition: var(--wcfc-transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Botón Editar (Gris) */
.wcfc-product-card-actions .wcfc-edit-btn {
    color: var(--wcfc-gray);
    border: 1.5px solid var(--wcfc-gray);
}

.wcfc-product-card-actions .wcfc-edit-btn:hover {
    background: var(--wcfc-gray);
    color: var(--wcfc-bg-main);
}

/* Botón Eliminar (Rojo) */
.wcfc-product-card-actions .wcfc-delete-btn {
    color: var(--wcfc-danger);
    border: 1.5px solid var(--wcfc-danger);
}

.wcfc-product-card-actions .wcfc-delete-btn:hover {
    background: var(--wcfc-danger);
    color: var(--wcfc-bg-main);
}

/* 6. Formulario de Edición en Tarjeta */
.wcfc-product-edit-form {
    padding: 1.5rem;
    background: var(--wcfc-bg-main);
    border-top: 1px solid var(--wcfc-border-color);
}

.wcfc-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (min-width: 480px) {
    .wcfc-edit-actions {
        flex-direction: row;
    }
    .wcfc-edit-actions .wcfc-update-btn {
        flex: 2;
    }
    .wcfc-edit-actions .wcfc-cancel-edit {
        flex: 1;
    }
}

/* 7. Alertas / Mensajes */
#wcfc-message-container {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--wcfc-radius);
    font-size: 0.95rem;
    text-align: center;
}

.wcfc-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.wcfc-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Botón de impresión (Ajuste global) */
.wcfc-print-label-btn {
    width: 100%;
    margin-top: 0.5rem;
}