/* Estilos para la Lista de Precios Leex - Frontend */

.lpl-price-list-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Contenedor de búsqueda */
.lpl-search-container {
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

.lpl-search-input {
    width: 100%;
    max-width: none;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.lpl-search-input:focus {
    border-color: #007cba;
    box-shadow: 0 4px 20px rgba(0,123,186,0.15);
    transform: translateY(-2px);
}

.lpl-search-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Mensaje de no resultados */
.lpl-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

.lpl-no-results p {
    font-size: 18px;
    color: #6c757d;
    margin: 0;
}

/* Contenedor de categorías */
.lpl-category-container {
    margin-bottom: 40px;
    background: #fff;
    overflow: hidden;
}

.lpl-category-container:hover {
    transform: none;
    box-shadow: none;
}

/* Encabezado de categoría */
.lpl-category-header {
    background: #fff;
    padding: 25px 30px 15px 30px;
    color: #333;
    position: relative;
}

.lpl-category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #00A5C2;
    width: 100%;
}

.lpl-category-header h3 {
    margin: 0;
    color: #333;
}

/* Contenedor de subcategorías */
.lpl-subcategory-container {
    padding: 20px 0;
    margin-bottom: 30px;
}

.lpl-subcategory-container:last-child {
    margin-bottom: 0;
}

.lpl-subcategory-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #495057;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Tabla de precios */
.lpl-price-table {
    /* Estilos eliminados - ya no se usa */
}

.lpl-price-table thead {
    /* Estilos eliminados - ya no se usa */
}

.lpl-price-table th {
    /* Estilos eliminados - ya no se usa */
}

.lpl-price-table tbody tr {
    /* Estilos eliminados - ya no se usa */
}

.lpl-price-table tbody tr:hover {
    /* Estilos eliminados - ya no se usa */
}

.lpl-price-table tbody tr:last-child {
    /* Estilos eliminados - ya no se usa */
}

.lpl-price-table td {
    /* Estilos eliminados - ya no se usa */
}

/* Columnas específicas */
.lpl-product-name {
    /* Estilos eliminados - ya no se usa */
}

.lpl-product-price {
    /* Estilos eliminados - ya no se usa */
}

.lpl-product-iva {
    /* Estilos eliminados - ya no se usa */
}

.lpl-product-garantia {
    /* Estilos eliminados - ya no se usa */
}

/* SKU del producto */
.lpl-product-sku {
    color: #6c757d;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 5px;
    display: inline-block;
}

/* Tabla price-table (formato interno) */
.price-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.price-table th {
    background: #0078A0;
    border: none;
    padding: 15px 20px;
    text-align: left;
    font-weight: bold;
    color: white;
    vertical-align: top;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.price-table th:first-child {
    width: auto;
    min-width: 0;
}

.price-table th:nth-child(2) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.price-table th:nth-child(3) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.price-table th:nth-child(4) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.price-table th strong {
    font-weight: bold;
    color: white;
    text-transform: none;
    letter-spacing: normal;
}

.price-table td {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 20px;
    text-align: left;
    vertical-align: top;
    color: #333;
    background: white;
}

.price-table td:first-child {
    width: auto;
    min-width: 0;
}

.price-table td:nth-child(2) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.price-table td:nth-child(3) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
}

.price-table td:nth-child(4) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
}

.price-table tr.item-row {
    background: white;
    transition: background-color 0.2s ease;
}

.price-table tr.item-row:hover {
    background: #f8f9fa;
}

.price-table tr.item-row:last-child td {
    border-bottom: none;
}

.price-table tr.item-row:nth-child(even) {
    background: #fafbfc;
}

.price-table tr.item-row:nth-child(even):hover {
    background: #f1f3f4;
}

/* Columna ocultar */
.columna-ocultar {
    /* Estilos para columnas que se pueden ocultar */
}

/* Responsive - Diseño de Cards para Móviles */
@media (max-width: 768px) {
    .lpl-price-list-container {
        padding: 15px;
    }
    
    .lpl-category-header {
        padding: 20px 20px 15px 20px;
        margin-bottom: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .lpl-subcategory-container {
        padding: 0;
        margin-bottom: 25px;
    }
    
    .lpl-subcategory-title {
        font-size: 18px;
        margin-bottom: 15px;
        padding: 15px 20px;
        background: linear-gradient(135deg, #0078A0, #00A5C2);
        color: white;
        border-radius: 10px;
        text-align: center;
        font-weight: 600;
        box-shadow: 0 3px 10px rgba(0,120,160,0.3);
        position: relative;
        overflow: hidden;
    }
    
    .lpl-subcategory-title::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        animation: shimmer 3s infinite;
    }
    
    @keyframes shimmer {
        0% { left: -100%; }
        100% { left: 100%; }
    }
    
    /* Convertir tabla a cards en móviles */
    .price-table {
        display: none !important; /* Ocultar tabla en móviles - forzar con !important */
    }
    
    /* Asegurar que las tablas estén ocultas incluso si tienen estilos inline */
    .lpl-subcategory-container .price-table {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Crear contenedor de cards */
    .lpl-subcategory-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .lpl-cards-container {
        display: flex !important;
        flex-direction: column;
        gap: 15px;
        margin-top: 10px;
    }
    
    /* Estilos para cards de productos (se aplicarán dinámicamente) */
    .lpl-product-card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        border: 1px solid #e9ecef;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .lpl-product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
    
    .lpl-product-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(135deg, #0078A0, #00A5C2);
    }
    
    .lpl-product-name {
        font-size: 16px;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 12px;
        line-height: 1.4;
    }
    
    .lpl-product-details {
        margin-top: 15px;
    }
    
    .lpl-detail-item {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 2px solid #e9ecef;
        transition: all 0.3s ease;
    }
    
    .lpl-detail-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .lpl-detail-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .lpl-detail-label {
        font-size: 12px;
        font-weight: 600;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-right: 15px;
    }
    
    .lpl-detail-value {
        font-size: 14px;
        font-weight: 700;
        color: #2c3e50;
        text-align: right;
    }
    
    .lpl-detail-value.price {
        color: #2c3e50;
        font-size: 14px;
        font-weight: 700;
    }
    
    .lpl-detail-value.garantia {
        color: #2c3e50;
        font-weight: 700;
        font-size: 14px;
    }
    
}

@media (max-width: 480px) {
    .lpl-search-input {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .lpl-category-header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .lpl-subcategory-container {
        padding: 0;
        gap: 12px;
    }
    
    .lpl-subcategory-title {
        font-size: 16px;
        padding: 12px 15px;
        margin-bottom: 12px;
    }
    
    .lpl-product-card {
        padding: 15px;
        border-radius: 10px;
    }
    
    .lpl-product-name {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .lpl-product-details {
        margin-top: 12px;
    }
    
    .lpl-detail-item {
        padding: 10px 12px;
        border-radius: 6px;
        gap: 8px;
    }
    
    .lpl-detail-row {
        gap: 10px;
    }
    
    .lpl-detail-label {
        font-size: 11px;
        margin-right: 10px;
    }
    
    .lpl-detail-value {
        font-size: 13px;
        font-weight: 700;
        color: #2c3e50;
        text-align: right;
    }
    
    .lpl-detail-value.price {
        font-size: 13px;
        font-weight: 700;
        color: #2c3e50;
    }
    
    .lpl-detail-value.garantia {
        font-size: 13px;
        font-weight: 700;
        color: #2c3e50;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lpl-category-container {
    animation: fadeIn 0.6s ease-out;
}

.lpl-category-container:nth-child(2) { animation-delay: 0.1s; }
.lpl-category-container:nth-child(3) { animation-delay: 0.2s; }
.lpl-category-container:nth-child(4) { animation-delay: 0.3s; }
.lpl-category-container:nth-child(5) { animation-delay: 0.4s; }

/* Estados de carga */
.lpl-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.lpl-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    border-top-color: #007cba;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mejoras de accesibilidad */
.lpl-price-table th[scope="col"] {
    position: relative;
}

.lpl-price-table th[scope="col"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #007cba;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.lpl-price-table th[scope="col"]:hover::after {
    transform: scaleX(1);
}

/* Estilos para productos sin precio */
.lpl-product-price:empty::before {
    content: 'Consultar';
    color: #6c757d;
    font-style: italic;
    font-weight: normal;
}

/* Estilos para productos sin IVA */
.lpl-product-iva:empty::before {
    content: 'N/A';
    color: #6c757d;
    font-style: italic;
    font-weight: normal;
}

/* Estilos para productos sin garantía */
.lpl-product-garantia:empty::before {
    content: 'N/A';
    color: #6c757d;
    font-style: italic;
    font-weight: normal;
}
