/* =============================================================================
   Toshiba Buscador Manuales — Estilos frontend (ficha de producto WooCommerce)
   ============================================================================= */

/* Sección principal */
#toshiba-manuals-section {
    margin-top: 40px;
}

/* Estado de carga */
.toshiba-manuals-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    color: #666;
    font-size: 14px;
}

.toshiba-manuals-loading__spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #c00;
    border-radius: 50%;
    animation: toshiba-spin .7s linear infinite;
    flex-shrink: 0;
}

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

/* Aviso de error */
.toshiba-manuals-error {
    padding: 14px 16px;
    background: #fff5f5;
    border-left: 4px solid #c00;
    border-radius: 2px;
    color: #660000;
    font-size: 14px;
    margin: 20px 0;
}

/* Aviso para usuarios no registrados */
.toshiba-manuals-login-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #f0c040;
    border-radius: 4px;
    font-size: 13px;
    color: #7a5c00;
    margin-top: 12px;
}

.toshiba-manuals-login-notice a {
    color: #7a5c00;
    font-weight: 600;
    text-decoration: underline;
}

/* Contenedor de la tabla */
.toshiba-manuals {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

/* Cabecera */
.toshiba-manuals__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.toshiba-manuals__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.toshiba-manuals__meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Tags de tipo */
.toshiba-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #1e3a5f;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.toshiba-tag--secondary {
    background: #4b5563;
}

/* Mensaje vacío */
.toshiba-manuals__empty {
    padding: 20px;
    color: #6b7280;
    font-style: italic;
    margin: 0;
}

/* Wrapper con scroll horizontal en móvil */
.toshiba-manuals__table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tabla */
.toshiba-manuals__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #374151;
}

.toshiba-manuals__table thead tr {
    background: #f3f4f6;
}

.toshiba-manuals__table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.toshiba-manuals__table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.toshiba-manuals__table tbody tr:last-child td {
    border-bottom: none;
}

.toshiba-manuals__table tbody tr:hover {
    background: #fafafa;
}

/* Celda de modelo con rowspan */
.toshiba-model-col {
    vertical-align: middle;
    background: #f0f4f8;
    border-right: 2px solid #d1d5db;
    white-space: nowrap;
    font-weight: 600;
}

/* Primera fila de cada grupo: separador superior */
.toshiba-group-first td,
.toshiba-group-first .toshiba-model-col {
    border-top: 2px solid #d1d5db;
}

.toshiba-manuals__table tbody tr:first-child.toshiba-group-first td {
    border-top: none;
}

/* Código de modelo */
.toshiba-model-code {
    font-family: monospace;
    font-size: 13px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    color: #111827;
}

/* Enlace de descarga */
.toshiba-download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    word-break: break-all;
    transition: color .15s;
}

.toshiba-download-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

.toshiba-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Badge de tipo de manual */
.toshiba-manual-type {
    display: inline-block;
    padding: 2px 8px;
    background: #e0f2fe;
    color: #075985;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Badge de idioma */
.toshiba-lang-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #dcfce7;
    color: #166534;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
}

/* =============================================================================
   Responsive — tabla adaptativa en pantallas pequeñas
   ============================================================================= */
@media (max-width: 600px) {
    .toshiba-manuals__table thead {
        display: none;
    }

    .toshiba-manuals__table,
    .toshiba-manuals__table tbody,
    .toshiba-manuals__table tr,
    .toshiba-manuals__table td {
        display: block;
        width: 100%;
    }

    .toshiba-manuals__table tr {
        border-bottom: 2px solid #e5e7eb;
        padding: 8px 0;
    }

    .toshiba-manuals__table tr:last-child {
        border-bottom: none;
    }

    .toshiba-manuals__table td {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 6px 16px;
        border-bottom: none;
        font-size: 13px;
    }

    .toshiba-manuals__table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        color: #9ca3af;
        min-width: 110px;
        flex-shrink: 0;
        padding-top: 2px;
    }

    .toshiba-manuals__header {
        flex-direction: column;
        align-items: flex-start;
    }
}
