/* Estilos para búsqueda TDS/SDS - Estilo BEHR */
/* Version: 1.0 */

.pps-tds-sds-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.pps-tds-sds-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    border-bottom: 3px solid #000;
}

.pps-tds-sds-title {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    color: #000;
}

/* Search Section */
.pps-tds-sds-search-section {
    background: #f5f5f5;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.pps-tds-sds-search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.pps-tds-sds-search-icon {
    font-size: 24px;
    color: #666;
    margin-right: 10px;
}

.pps-tds-sds-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.pps-tds-sds-search-input::placeholder {
    color: #999;
    text-transform: uppercase;
    font-weight: 400;
}

.pps-tds-sds-search-btn,
.pps-tds-sds-clear-btn {
    padding: 10px 30px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.pps-tds-sds-search-btn {
    background: #de3838;
    color: #fff;
}

.pps-tds-sds-search-btn:hover {
    background: #c42f2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(222, 56, 56, 0.3);
}

.pps-tds-sds-clear-btn {
    background: #666;
    color: #fff;
}

.pps-tds-sds-clear-btn:hover {
    background: #333;
}

/* Filters */
.pps-tds-sds-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.pps-tds-sds-filters label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-right: 5px;
}

.pps-tds-sds-category-select {
    padding: 8px 15px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 200px;
    font-weight: 500;
}

.pps-tds-sds-category-select:focus {
    outline: none;
    border-color: #de3838;
}

/* Loading */
.pps-tds-sds-loading {
    text-align: center;
    padding: 60px 20px;
}

.pps-tds-sds-loading .spinner {
    float: none;
    margin: 0 auto 20px;
}

.pps-tds-sds-loading p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Results Table */
.pps-tds-sds-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.pps-tds-sds-table thead {
    background: #2c2c2c;
    color: #fff;
}

.pps-tds-sds-table thead th {
    padding: 15px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #444;
}

.pps-tds-sds-table thead th:last-child {
    border-right: none;
}

.pps-tds-sds-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.pps-tds-sds-table tbody tr:hover {
    background-color: #f9f9f9;
}

.pps-tds-sds-table tbody td {
    padding: 15px 12px;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

.pps-tds-sds-product-name {
    font-weight: 600;
    color: #de3838;
    max-width: 300px;
}

.pps-tds-sds-product-number {
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.pps-tds-sds-document {
    text-align: center;
    white-space: nowrap;
}

.pps-tds-sds-link {
    display: inline-block;
    padding: 6px 16px;
    background: #de3838;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.pps-tds-sds-link:hover {
    background: #c42f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(222, 56, 56, 0.3);
}

.pps-tds-sds-na {
    color: #999;
    font-weight: 400;
}

.pps-tds-sds-info {
    max-width: 300px;
}

.pps-tds-sds-category-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pps-tds-sds-category-label {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pps-tds-sds-info-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pps-tds-sds-category {
    display: inline-block;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.pps-tds-sds-category:not(:last-child)::after {
    content: '•';
    margin-left: 8px;
    color: #999;
}

/* Legacy badge styles (deprecated - mantener por compatibilidad) */
.pps-tds-sds-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #4caf50;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.pps-tds-sds-badge:nth-child(2) {
    background: #2196f3;
}

.pps-tds-sds-badge:nth-child(3) {
    background: #ff9800;
}

.pps-tds-sds-badge:nth-child(4) {
    background: #9c27b0;
}

/* Count */
.pps-tds-sds-count {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* No Results */
.pps-tds-sds-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pps-tds-sds-no-results {
    font-size: 18px;
    color: #666;
}

/* Error */
.pps-tds-sds-error {
    text-align: center;
    padding: 30px 20px;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    border: 1px solid #ef5350;
}

/* Responsive */
@media (max-width: 1024px) {
    .pps-tds-sds-table {
        font-size: 13px;
    }
    
    .pps-tds-sds-table thead th,
    .pps-tds-sds-table tbody td {
        padding: 12px 8px;
    }
}

@media (max-width: 768px) {
    .pps-tds-sds-title {
        font-size: 24px;
    }
    
    .pps-tds-sds-search-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pps-tds-sds-search-btn,
    .pps-tds-sds-clear-btn {
        flex: 1;
        margin-left: 0;
    }
    
    .pps-tds-sds-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pps-tds-sds-category-select {
        width: 100%;
    }
    
    /* Convert table to cards on mobile */
    .pps-tds-sds-table,
    .pps-tds-sds-table thead,
    .pps-tds-sds-table tbody,
    .pps-tds-sds-table tr,
    .pps-tds-sds-table td {
        display: block;
        width: 100%;
    }
    
    .pps-tds-sds-table thead {
        display: none;
    }
    
    .pps-tds-sds-table tbody tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .pps-tds-sds-table tbody td {
        padding: 8px 0;
        border: none;
        text-align: left !important;
    }
    
    .pps-tds-sds-table tbody td:before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 11px;
        color: #666;
        display: block;
        margin-bottom: 5px;
    }
    
    .pps-tds-sds-product-name {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .pps-tds-sds-document {
        display: inline-block;
        margin-right: 10px;
    }
}
