/* ============================================================================
   🎴 productCard.css - Estilos Completos de Tarjeta de Producto
   ============================================================================
   ✅ Combina estilos de product-card-clickable.css + optimizaciones
   ✅ Badge → Título principal
   ✅ Título → Descripción (clickeable)
   ✅ Código con "ID: XXX"
   ✅ Precios en español estructurados
   ✅ Sin duplicación de código
   ============================================================================ */

/* ============================================================================
   📦 CONTENEDOR DE LA TARJETA
   ============================================================================ */
.block2 {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.block2:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   📸 IMAGEN DEL PRODUCTO (Clickeable)
   ============================================================================ */
.block2-pic {
    position: relative;
    width: 100%;
    padding-bottom: 85%;
    overflow: hidden;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
}

.block2-pic img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
    cursor: pointer;
}

.block2-pic:hover img {
    transform: scale(1.08);
    filter: brightness(0.95);
}

/* Overlay sutil en hover */
.block2-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.block2-pic:hover .block2-overlay {
    background: rgba(0, 0, 0, 0.08);
}

/* ============================================================================
   🚫 OCULTAR BADGE VISUAL DE LA IMAGEN
   ============================================================================ */
.badge-categoria {
    display: none !important;
}

/* ============================================================================
   📋 CONTENEDOR DE INFORMACIÓN
   ============================================================================ */
.block2-txt {
    padding: 12px 5% 12px 5%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   📐 REORDENAR ELEMENTOS CON FLEXBOX
   ============================================================================ */
.block2-txt-child1 {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
}

/* ============================================================================
   🏷️ TÍTULO PRINCIPAL (Badge convertido en título)
   ============================================================================ */
.product-category-title {
    order: 1;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -1px;
    font-family: 'Poppins-Medium';
    color: #222;
    margin-bottom: 8px;
    line-height: 1.3;
    text-transform: capitalize;
}

/* ============================================================================
   📖 DESCRIPCIÓN (Título convertido en descripción - Clickeable)
   ============================================================================ */
.product-title {
    order: 2 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #888 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.6 !important;
    min-height: auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.product-title-link {
    font-size: 13px !important;
    color: #888 !important;
    font-weight: 400 !important;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
}

.product-title-link:hover {
    color: #717fe0 !important;
    text-decoration: none;
}

.product-title-link:active {
    color: #5a6bc7;
}

/* ============================================================================
   🔢 CÓDIGO DEL PRODUCTO CON FORMATO "ID: XXX"
   ============================================================================ */
.product-code {
    order: 3 !important;
    display: block !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #aaa !important;
    margin-bottom: 18px !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
}

/* Agregar "ID: " antes del código */
.product-code::before {
    content: "ID: ";
    font-weight: 600;
    color: #999;
}

/* ============================================================================
   💰 PRECIOS CON ESTRUCTURA EN ESPAÑOL
   ============================================================================ */
.precios-container {
    order: 4 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: auto !important;
    padding-top: 0 !important;
}

/* ============================================
   Precio General - "Por unidad:"
   ============================================ */
.precio-general {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 !important;
    border-bottom: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #888 !important;
}

.precio-general::before {
    content: "Por unidad:";
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

/* Precio valor en rojo */
.precio-general {
    font-weight: 700 !important;
    color: #e74c3c !important;
}

/* ============================================
   Precio Mayor - "Por mayor (6+):"
   ============================================ */
.precio-mayor {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 !important;
    border-bottom: none !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #27ae60 !important;
}

.precio-mayor::before {
    content: "Por mayor (6+):";
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

/* ============================================
   Precio Docena - "Por docena (12+):"
   ============================================ */
.precio-docena {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 !important;
    border-bottom: none !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #17a2b8 !important;
}

.precio-docena::before {
    content: "Por docena (12+):";
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

/* ============================================================================
   🛒 ZONA DE ACCIONES
   ============================================================================ */
.product-actions {
    order: 5 !important;
    margin-top: 15px !important;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-actions-hint {
    font-size: 11px;
    color: #999;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-actions-hint i {
    font-size: 14px;
    color: #717fe0;
}

/* ============================================================================
   📱 RESPONSIVE - MÓVIL
   ============================================================================ */
@media (max-width: 767px) {
    
    .block2-pic:hover img {
        transform: scale(1.05);
    }
    
    .product-category-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .product-title {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }
    
    .product-code {
        font-size: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .precio-general {
        font-size: 13px !important;
    }
    
    .precio-mayor,
    .precio-docena {
        font-size: 13px !important;
    }
    
    .precio-general::before,
    .precio-mayor::before,
    .precio-docena::before {
        font-size: 13px;
    }
    
    .precios-container {
        gap: 8px !important;
    }
    
    .product-actions-hint {
        font-size: 10px;
    }
    
    .product-actions {
        margin-top: 12px !important;
        padding-top: 10px;
    }
    
    .block2:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 480px) {
    
    .product-category-title {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    .product-code {
        font-size: 10px !important;
        margin-bottom: 12px !important;
    }
    
    .precios-container {
        gap: 7px !important;
    }
    
    .product-actions {
        padding-top: 8px;
        margin-top: 10px !important;
    }
}

/* ============================================================================
   ♿ ACCESIBILIDAD
   ============================================================================ */

/* Focus visible para navegación con teclado */
.product-title-link:focus,
.block2-pic img:focus {
    outline: 2px solid #717fe0;
    outline-offset: 2px;
}

/* Mejorar contraste en modo alto contraste */
@media (prefers-contrast: high) {
    .product-title-link {
        color: #000 !important;
    }
    
    .product-title-link:hover {
        color: #00f !important;
    }
    
    .product-code {
        color: #666 !important;
    }
}

/* ============================================================================
   🎨 ANIMACIONES Y TRANSICIONES
   ============================================================================ */
.block2-pic img,
.block2-overlay,
.product-title-link,
.block2 {
    transition-timing-function: ease-out;
}

/* ============================================================================
   📝 NOTAS DE IMPLEMENTACIÓN
   ============================================================================
   
   Este archivo REEMPLAZA:
   - product-card-clickable.css (incorporado aquí)
   - Estilos de .block2 en products.css (eliminar de products.css)
   
   ORDEN DE CARGA EN HTML:
   1. products.css (sin estilos de .block2, .block2-pic, etc.)
   2. productCard.css (este archivo) ← ÚLTIMO
   
   ============================================================================ */