/* ============================================
   WooCommerce Frontend Product Capture - Estilos
   ============================================ */

/* Contenedores principales */
.wcfc-form-container,
.wcfc-products-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcfc-products-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Grupos de formulario */
.wcfc-form-group {
    margin-bottom: 25px;
}

.wcfc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.wcfc-form-group input[type="text"],
.wcfc-form-group input[type="number"],
.wcfc-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.wcfc-form-group input[type="text"]:focus,
.wcfc-form-group input[type="number"]:focus,
.wcfc-form-group textarea:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.wcfc-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Área de subida de imágenes - Destacada */
.wcfc-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    background-color: #f8f9fa;
}

.wcfc-upload-area:hover {
    border-color: #007cba;
    background-color: #e7f3ff;
}

.wcfc-upload-area.highlight {
    border-color: #007cba;
    background-color: #e3f2fd;
}

.wcfc-upload-prompt {
    color: #6c757d;
}

.wcfc-upload-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    transition: background 0.2s;
}

.wcfc-upload-btn:hover {
    background: #005a87;
}

.wcfc-image-preview {
    margin-top: 20px;
    position: relative;
    display: inline-block;
}

.wcfc-image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.wcfc-remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wcfc-remove-image:hover {
    background: #c82333;
}

/* Galería de imágenes adicionales */
.wcfc-gallery-area {
    border: 2px dashed #ced4da;
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
    background-color: #f8f9fa;
    transition: border-color 0.3s;
}

.wcfc-gallery-area:hover {
    border-color: #007cba;
}

.wcfc-gallery-prompt {
    text-align: center;
    color: #6c757d;
    margin-bottom: 15px;
}

.wcfc-gallery-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.wcfc-gallery-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wcfc-gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcfc-gallery-preview-item .wcfc-remove-gallery-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wcfc-gallery-preview-item .wcfc-remove-gallery-image:hover {
    background: #c82333;
}

/* Botones principales */
.wcfc-submit-btn,
.wcfc-update-btn,
.wcfc-edit-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    display: inline-block;
}

.wcfc-submit-btn:hover,
.wcfc-update-btn:hover,
.wcfc-edit-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.wcfc-submit-btn:active,
.wcfc-update-btn:active,
.wcfc-edit-btn:active {
    transform: translateY(0);
}

.wcfc-cancel-edit {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    transition: background 0.2s;
}

.wcfc-cancel-edit:hover {
    background: #5a6268;
}

/* Lista de productos - Tarjetas verticales */
.wcfc-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.wcfc-product-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
}

.wcfc-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Imagen del producto en tarjeta */
.wcfc-product-image {
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.wcfc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.wcfc-product-card:hover .wcfc-product-image img {
    transform: scale(1.05);
}

/* Detalles del producto */
.wcfc-product-details {
    padding: 20px;
    flex: 1;
}

.wcfc-product-details h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.3;
}

.wcfc-product-price {
    font-weight: 700;
    color: #28a745;
    font-size: 20px;
    margin: 0 0 8px 0;
}

.wcfc-product-sku,
.wcfc-product-date {
    color: #6c757d;
    font-size: 14px;
    margin: 5px 0;
}

.wcfc-product-short-desc {
    margin: 12px 0;
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Código QR en tarjeta */
.wcfc-product-qr {
    margin: 15px 0 10px;
    text-align: center;
}

.wcfc-product-qr img {
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 5px;
    background: white;
}

/* Botón de edición en tarjeta */
.wcfc-edit-btn {
    width: 100%;
    padding: 12px;
    border-radius: 0 0 12px 12px;
    background: #007cba;
    font-size: 14px;
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.wcfc-edit-btn:hover {
    background: #005a87;
}

/* Formulario de edición dentro de la tarjeta */
.wcfc-product-edit-form {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 15px;
    border: 1px solid #dee2e6;
}

.wcfc-product-edit-form .wcfc-form-group {
    margin-bottom: 15px;
}

.wcfc-product-edit-form label {
    font-size: 14px;
    margin-bottom: 4px;
}

.wcfc-product-edit-form input[type="text"],
.wcfc-product-edit-form input[type="number"],
.wcfc-product-edit-form textarea {
    padding: 8px 12px;
    font-size: 14px;
}

.wcfc-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.wcfc-edit-actions .wcfc-update-btn {
    flex: 2;
    padding: 10px;
    font-size: 14px;
}

.wcfc-edit-actions .wcfc-cancel-edit {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    margin-left: 0;
}

/* Mensajes */
#wcfc-message-container {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
}

.wcfc-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcfc-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .wcfc-form-container,
    .wcfc-products-container {
        margin: 15px;
        padding: 20px;
    }
    
    .wcfc-products-grid {
        grid-template-columns: 1fr;
    }
    
    .wcfc-upload-btn {
        display: block;
        margin: 10px auto 0;
    }
    
    .wcfc-upload-prompt span {
        display: block;
        margin-bottom: 10px;
    }
}